HEX
Server: LiteSpeed
System: Linux linux31.centraldnserver.com 4.18.0-553.83.1.lve.el8.x86_64 #1 SMP Wed Nov 12 10:04:12 UTC 2025 x86_64
User: salamatk (1501)
PHP: 8.1.33
Disabled: show_source, system, shell_exec, passthru, exec, popen, proc_open
Upload Files
File: /home/salamatk/takarzan.ir/wp-content/themes/xts-luman/js/scripts/variationsPrice.js
/* global xts_settings */
(function($) {
	XTSThemeModule.$document.on('xtsProductQuickViewOpen', function() {
		XTSThemeModule.variationsPrice();
	});

	XTSThemeModule.variationsPrice = function () {
		if ('no' === xts_settings.single_product_variations_price) {
			return;
		}

		$('.xts-single-product .variations_form').each(function () {
			var $form = $(this);
			var $price = $form.parent().find('.price').first();

			if ( 0 === $price.length ) {
				$price = $('.elementor-widget-xts_single_product_price .price');
			}

			var priceOriginalHtml = $price.html();

			$form.on('show_variation', function (e, variation) {
				if (variation.price_html.length > 1) {
					$price.html(variation.price_html);
				}

				$form.addClass('xts-price-outside');
			});

			$form.on('hide_variation', function () {
				$price.html(priceOriginalHtml);
				$form.removeClass('xts-price-outside');
			});
		});
	};

	$(document).ready(function() {
		XTSThemeModule.variationsPrice();
	});
})(jQuery);