public function render()
 {
     if (yith_wcmg_is_enabled() && !$this->is_video_featured_enabled()) {
         //change the templates
         remove_action('woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20);
         remove_action('woocommerce_product_thumbnails', 'woocommerce_show_product_thumbnails', 20);
         add_action('woocommerce_before_single_product_summary', array($this, 'show_product_images'), 20);
         add_action('woocommerce_product_thumbnails', array($this, 'show_product_thumbnails'), 20);
         //custom styles and javascripts
         add_action('wp_enqueue_scripts', array($this, 'enqueue_styles_scripts'));
         //add attributes to product variations
         add_filter('woocommerce_available_variation', array($this, 'available_variation'), 10, 3);
     }
 }
		
	<?php 
}
?>



	<?php 
do_action('woocommerce_product_thumbnails');
?>


</div>

<?php 
if (yith_wcmg_is_enabled()) {
    ?>

<script type="text/javascript" charset="utf-8">
var yith_magnifier_options = {
	enableSlider: <?php 
    echo $enable_slider ? 'true' : 'false';
    ?>
,

	<?php 
    if ($enable_slider) {
        ?>

	sliderOptions: {
		//responsive: true,
			<a itemprop="image" href="<?php yit_image( 'size=shop_magnifier&output=url' ) ?>" class="yith_magnifier_zoom" rel="thumbnails"><?php yit_image( $image_args ) ?></a>
			
		<?php else: ?>
			
			<img src="<?php echo wc_placeholder_img_src(); ?>" alt="Placeholder" />
			
		<?php endif ?>
		
	<?php endif ?>


	<?php do_action('woocommerce_product_thumbnails'); ?>

</div>

<?php if( yith_wcmg_is_enabled() ): ?>
<script type="text/javascript" charset="utf-8">
var yith_magnifier_options = {
	enableSlider: <?php echo get_option('yith_wcmg_enableslider') == 'yes' ? 'true' : 'false' ?>,

	<?php if( get_option('yith_wcmg_enableslider') == 'yes' ): ?>
	sliderOptions: {
		responsive: false,
		//items: <?php //echo get_option('yith_wcmg_slider_items') ?>,
		circular: <?php echo get_option('yith_wcmg_slider_circular') == 'yes' ? 'true' : 'false' ?>,
		infinite: <?php echo get_option('yith_wcmg_slider_infinite') == 'yes' ? 'true' : 'false' ?>,
		direction: 'left',
		debug: false,
		auto: false,
		align: 'left',
		prev	: {	
Esempio n. 4
0
<?php
/**
 * Variable product add to cart
 *
 * @author        WooThemes
 * @package       WooCommerce/Templates
 * @version       2.1.0
 */

if ( ! defined( 'ABSPATH' ) ) {
    exit;
} // Exit if accessed directly
global $woocommerce, $product, $post;

// resize the main image of each variations
if ( function_exists( 'yith_wcmg_is_enabled' ) && yith_wcmg_is_enabled() ) {
    foreach ( $available_variations as $variation_id => $variation ) {
        $available_variations[$variation_id]['image_src']       = yit_image( "src=$variation[image_src]&size=shop_single&output=url", false );
        $available_variations[$variation_id]['image_magnifier'] = yit_image( "src=$variation[image_magnifier]&size=shop_magnifier&output=url", false );
    }
}

/* woocommerce subscription price fix */
$class_subscription = "";
if ( $product->product_type == 'variable-subscription' ) {
    $class_subscription = "subscription";
    $woo_option         = get_option( 'woocommerce_subscriptions_add_to_cart_button_text' );
    $label              = $woo_option ? $woo_option : apply_filters( 'subscription_add_to_cart_text', __( 'Sign Up Now', 'yit' ) );
}
else {
    $label = apply_filters( 'single_add_to_cart_text',yit_icl_translate( "theme", "yit", "add_to_cart_text", yit_get_option( 'add-to-cart-text' ) ));
Esempio n. 5
0
<?php
/**
 * Variable product add to cart
 *
 * @author        WooThemes
 * @package       WooCommerce/Templates
 * @version       2.3.0
 */

if ( ! defined( 'ABSPATH' ) ) {
    exit;
} // Exit if accessed directly
global $product, $post;

// resize the main image of each variations
if ( function_exists( 'yith_wcmg_is_enabled' ) && yith_wcmg_is_enabled() && !is_quick_view() ) {
    foreach ( $available_variations as $variation_id => $variation ) {
        $available_variations[$variation_id]['image_src']       = yit_image( "src=$variation[image_src]&size=shop_single&output=url", false );
        $available_variations[$variation_id]['image_magnifier'] = yit_image( "src=$variation[image_magnifier]&size=shop_magnifier&output=url", false );
    }
}

/* woocommerce subscription price fix */
$class_subscription = "";
if ( $product->product_type == 'variable-subscription' ) {
    $class_subscription = "subscription";
    $woo_option         = get_option( 'woocommerce_subscriptions_add_to_cart_button_text' );
    $label              = $woo_option ? $woo_option : apply_filters( 'subscription_add_to_cart_text', __( 'Sign Up Now', 'yit' ) );
}
else {
    $label = apply_filters( 'single_add_to_cart_text',yit_icl_translate( "theme", "yit", "add_to_cart_text", yit_get_option( 'add-to-cart-text' ) ) , $product->product_type );