debug: false, auto: false, align: 'left', height: 'auto', //height: "100%", //turn vertical //width: 105, //turn vertical prev : { button : "#slider-prev", key : "left" }, next : { button : "#slider-next", key : "right" }, //width : <?php echo yit_shop_single_w() + 18; ?> , scroll : { items : 1, pauseOnHover: true }, items : { //width: <?php echo yit_shop_thumbnail_w() + 4; ?> , visible: <?php echo apply_filters('woocommerce_product_thumbnails_columns', $slider_items); ?> },
function yit_size_images_style() { $content_width = yit_get_sidebar_layout() == 'sidebar-no' ? 1170 : 870; $margin = 30 / $content_width * 100; // 30px $margin_thumbnails = 8 / $content_width * 100; // 8px $images_container_w = yit_shop_single_w() / $content_width * 100; $thumbnails_container_w = $content_width - (yit_shop_single_w() + 30) - $margin_thumbnails; ?> <style type="text/css"> ul.products li.product.list .product-wrapper { padding-left:<?php echo yit_shop_catalog_w() + 30 + 7 + 2; ?> px; } ul.products li.product.list .product-wrapper a.thumb { margin-left:-<?php echo yit_shop_catalog_w() + 30 + 7 + 2; ?> px; width: <?php echo yit_shop_catalog_w(); ?> px; } .single-product.woocommerce div.product.product-layout-1 div.images { width:<?php echo $images_container_w; ?> %; } .single-product.woocommerce div.product.product-layout-1 div.images .thumbnails { width:<?php echo $thumbnails_container_w / yit_shop_single_w() * 100; ?> %; } .single-product.woocommerce div.product.product-layout-1 div.summary { width:<?php echo 100 - $images_container_w - $margin; ?> %; } </style> <?php }
<?php /** * Single Product Image * * @author YIThemes * @package YITH_Magnifier/Templates * @version 1.0.0 */ if (!defined('ABSPATH')) { exit; } // Exit if accessed directly global $post, $product, $woocommerce; $columns = floor((yit_shop_single_w() + 16) / (yit_shop_thumbnail_w() + 16)); $attachment_ids = $product->get_gallery_attachment_ids(); // add featured image if (!empty($attachment_ids)) { array_unshift($attachment_ids, get_post_thumbnail_id()); } $enable_slider = (bool) (get_option('yith_wcmg_enableslider') == 'yes' && count($attachment_ids) > $columns); if ($attachment_ids) { ?> <div class="thumbnails <?php echo $enable_slider ? 'slider' : 'noslider'; ?> "> <ul class="clearfix yith_magnifier_gallery"> <?php $loop = 0; $columns = apply_filters('woocommerce_product_thumbnails_columns', $columns);
function yit_size_images_style() { $content_width = yit_get_sidebar_layout() == 'sidebar-no' ? 1170 : 870; $margin = 30 / $content_width * 100; // 30px $margin_thumbnails = 8 / $content_width * 100; // 8px $images_container_w = (yit_shop_single_w() + 16) / $content_width * 100; $thumbnails_container_w = $content_width - (yit_shop_single_w() + 16 + 30) - $margin_thumbnails; ?> <style type="text/css"> ul.products li.product.list .product-wrapper { padding-left: <?php echo yit_shop_catalog_w() + 30 + 7 + 2; ?> px; min-height: <?php echo yit_shop_catalog_h() + 7 + 2; ?> px; } ul.products li.product.list .product-wrapper .thumb-wrapper { margin-left: -<?php echo yit_shop_catalog_w() + 30 + 7 + 2; ?> px; width: <?php echo yit_shop_catalog_w() + 10; ?> px; height: <?php echo yit_shop_catalog_h() + 8; ?> px; } ul.products li.product.list .product-wrapper img.onsale { left: <?php echo yit_shop_catalog_w() + 3 - 63; ?> px; } .og-expander.woocommerce div.product div.images div.thumbnails { height: <?php echo yit_shop_thumbnail_h() + 10; ?> px; } .single-product.woocommerce div.product.product-layout-1 div.images { width: <?php echo $images_container_w; ?> %; } .single-product.woocommerce div.product.product-layout-1 div.summary { width: <?php echo 100 - $images_container_w - $margin; ?> %; padding-bottom: <?php echo yit_shop_thumbnail_h(); ?> px; } </style> <?php }
/** * Set image and content width for single product image * * @return array * @since 1.0.0 * @author Francesco Licando <*****@*****.**> */ function yit_image_content_single_width() { $size = array(); if ( ( yit_get_option( 'general-layout-type' ) == 'fluid' && ! wp_is_mobile() ) || is_quick_view() ) return $size; $img_size = yit_shop_single_w(); $sidebar = YIT_Layout()->sidebars; if ( intval( $img_size ) < $GLOBALS['content_width'] ) { $size['image'] = ( intval( $img_size ) * 100 ) / $GLOBALS['content_width']; if ( $sidebar['layout'] != 'sidebar-no' && ! wp_is_mobile() ) $size['image'] -= 20; } else { $size['image'] = 100; } $size['content'] = 100 - ( $size['image'] ); $min_size = ( wp_is_mobile() ) ? '40' : '20'; if ( $size['content'] < $min_size ) { $size['content'] = 100; } return $size; }
* * @author WooThemes * @package WooCommerce/Templates * @version 2.0.3 */ if (!defined('ABSPATH')) { exit; } // Exit if accessed directly global $post, $woocommerce, $product; ?> <div class="thumbnails nomagnifier"><?php $attachments = $product->get_gallery_attachment_ids(); if ($attachments) { $loop = 0; $columns = apply_filters('woocommerce_product_thumbnails_columns', floor(yit_shop_single_w() / yit_shop_thumbnail_w())); foreach ($attachments as $attachment_id) { $attachment = get_post($attachment_id); if (get_post_meta($attachment_id, '_woocommerce_exclude_image', true) == 1) { continue; } $classes = array('zoom'); if ($loop == 0 || $loop % $columns == 0) { $classes[] = 'first'; } if (($loop + 1) % $columns == 0) { $classes[] = 'last'; } echo apply_filters('woocommerce_single_product_image_thumbnail_html', sprintf('<a href="%s" title="%s" data-rel="prettyPhoto[product-gallery]" class="%s">%s</a>', wp_get_attachment_url($attachment->ID), esc_attr($attachment->post_title), implode(' ', $classes), yit_image("id={$attachment->ID}&size=" . apply_filters('single_product_small_thumbnail_size', 'shop_thumbnail'), false))); $loop++; }
/** * Include responsive css file after all stylesheets loaded */ function yit_global_object() { wp_localize_script('jquery', 'yit', array('isRtl' => is_rtl(), 'ajaxurl' => admin_url('admin-ajax.php'), 'responsive_menu_text' => __('Navigate to...', 'yit'), 'price_filter_slider' => yit_get_option('shop-price-filter-style'), 'added_to_cart_text' => __('Added to cart', 'yit'), 'general_layout_type' => yit_get_option('general-layout-type'), 'single_image_width' => function_exists('yit_shop_single_w') ? yit_shop_single_w() : false, 'load_gif' => YIT_THEME_ASSETS_URL . '/images/search.gif')); }
/** * Set image and content width for single product image * * @return array * @since 1.0.0 * @author Francesco Licando <*****@*****.**> */ function yit_image_content_single_width() { $size = array(); if (is_quick_view()) { return $size; } $img_size = yit_shop_single_w(); $sidebar = YIT_Layout()->sidebars; if (intval($img_size) < $GLOBALS['content_width']) { $size['image'] = intval($img_size) * 100 / $GLOBALS['content_width']; if ($sidebar['layout'] != 'sidebar-no' && !wp_is_mobile()) { $size['image'] -= 20; } } else { $size['image'] = 100; } $size['content'] = 100 - $size['image']; $min_size = wp_is_mobile() ? '40' : '20'; if ($size['content'] < $min_size) { $size['content'] = 100; } return $size; }