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: //proc/self/cwd/wp-content/themes/xts-luman/templates/elementor/single-product/gallery.php
<?php
/**
 * Product gallery function
 *
 * @package xts
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Direct access not allowed.
}

if ( ! function_exists( 'xts_single_product_gallery_template' ) ) {
	/**
	 * Product gallery template
	 *
	 * @since 1.0.0
	 *
	 * @param array $element_args Associative array of arguments.
	 */
	function xts_single_product_gallery_template( $element_args ) {
		if ( ! xts_is_woocommerce_installed() ) {
			return;
		}

		$default_args = array(
			'thumbnails_gallery_position'   => 'bottom',
			'main_gallery_click_action'     => 'zoom',
			'main_gallery_photoswipe_btn'   => '1',
			'main_gallery_lightbox_gallery' => '1',
			'thumbnails_gallery_count'      => array( 'size' => 4 ),
			'source'                        => 'elementor',
			'product_badges'                => '0',
		);

		$args = wp_parse_args( $element_args, $default_args );

		if ( $args['main_gallery_photoswipe_btn'] && 'photoswipe' !== $args['main_gallery_click_action'] ) {
			add_action( 'xts_single_product_main_gallery_action_buttons', 'xts_single_product_photoswipe_btn', 10 );
		} else {
			remove_action( 'xts_single_product_main_gallery_action_buttons', 'xts_single_product_photoswipe_btn', 10 );
		}

		if ( ! $args['product_badges'] ) {
			remove_action( 'woocommerce_sale_flash', 'xts_product_labels', 100 );
			add_filter( 'woocommerce_sale_flash', '__return_false', 100 );
		}

		if ( 'zoom' === $args['main_gallery_click_action'] ) {
			wp_enqueue_script( 'wc-zoom' );
		} else {
			wp_dequeue_script( 'wc-zoom' );
		}

		wc_get_template( 'single-product/product-image.php', $args );

		if ( ! $args['product_badges'] ) {
			add_filter( 'woocommerce_sale_flash', 'xts_product_labels', 100 );
		}
	}
}