<?php /** * Single Product Image * * @author YIThemes * @package YITH_Magnifier/Templates * @version 1.0.0 */ global $post, $woocommerce, $product, $yith_wcmg; $columns = floor(yiw_shop_large_w() / (yiw_shop_thumbnail_w() + 18)); $enable_slider = (bool) (get_option('yith_wcmg_enableslider') == 'yes' && count($product->get_gallery_attachment_ids()) + 1 > $columns); ?> <div class="images"> <?php if (!yith_wcmg_is_enabled()) { ?> <!-- Default Woocommerce Template --> <?php if (has_post_thumbnail()) { ?> <a itemprop="image" href="<?php echo wp_get_attachment_url(get_post_thumbnail_id()); ?>
function yiw_size_images_style() { $thumb_cols = apply_filters('single_thumbnail_columns', 3); ?> .products.traditional li { width:<?php echo yiw_shop_small_w() + (yiw_get_option('shop_border_thumbnail') ? 14 : 0); ?> px !important; } .products li a strong { width:<?php echo yiw_shop_small_w() - 30; ?> px !important; } .products.traditional li a img { width:<?php echo yiw_shop_small_w(); ?> px !important; } div.product div.images { width:<?php echo (yiw_shop_large_w() + 14) / 720 * 100; ?> %; } .layout-sidebar-no div.product div.images { width:<?php echo (yiw_shop_large_w() + 14) / 960 * 100; ?> %; } div.product div.images img { width:<?php echo yiw_shop_large_w(); ?> px; } .layout-sidebar-no div.product div.summary { width:<?php echo (960 - (yiw_shop_large_w() + 14) - 20) / 960 * 100; ?> %; } .layout-sidebar-right div.product div.summary, .layout-sidebar-left div.product div.summary { width:<?php echo (720 - (yiw_shop_large_w() + 14) - 20) / 720 * 100; ?> %; } .layout-sidebar-no .product.hentry > span.onsale { right:<?php echo 960 - (yiw_shop_large_w() + 14) - 10; ?> px; left:auto; } .layout-sidebar-right .product.hentry > span.onsale, .layout-sidebar-left .product.hentry > span.onsale { right:<?php echo 720 - (yiw_shop_large_w() + 14) - 10; ?> px; left:auto; } <?php }
function yiw_size_images_style() { ?> .shop-traditional .products li { width:<?php echo yiw_shop_small_w() + (yiw_get_option('shop_border_thumbnail') ? 14 : 0); ?> px !important; } .shop-traditional .products li img { width:<?php echo yiw_shop_small_w(); ?> px; } .shop-traditional .products li.category img { width:<?php echo yiw_shop_category_w(); ?> px; } .shop-ribbon .products li { width:<?php echo yiw_shop_small_w() + 5; ?> px !important; } .shop-ribbon .products li.category { width: auto !important; } .products li a strong { width:<?php echo yiw_shop_small_w() - 30; ?> px !important; } /*..shop-traditional .products li a img { width:<?php echo yiw_shop_small_w(); ?> px !important; } removed for the category images */ div.product div.images { width:<?php echo (yiw_shop_large_w() + 14) / 720 * 100; ?> %; } .layout-sidebar-no div.product div.images { width:<?php echo (yiw_shop_large_w() + 14) / 960 * 100; ?> %; } div.product div.images img { width:<?php echo yiw_shop_large_w(); ?> px; } .layout-sidebar-no div.product div.summary { width:<?php echo (960 - (yiw_shop_large_w() + 14) - 20) / 960 * 100; ?> %; } .layout-sidebar-right div.product div.summary, .layout-sidebar-left div.product div.summary { width:<?php echo (720 - (yiw_shop_large_w() + 14) - 20) / 720 * 100; ?> %; } .layout-sidebar-no .product.hentry > span.onsale { right:<?php echo 960 - (yiw_shop_large_w() + 14) - 10; ?> px; left:auto; } .layout-sidebar-right .product.hentry > span.onsale, .layout-sidebar-left .product.hentry > span.onsale { right:<?php echo 720 - (yiw_shop_large_w() + 14) - 10; ?> px; left:auto; } <?php }
<?php /** * Single Product Image * * @author YIThemes * @package YITH_Magnifier/Templates * @version 1.0.0 */ global $post, $product, $woocommerce; $columns = apply_filters('woocommerce_product_thumbnails_columns', get_option('yith_wcmg_slider_items', floor(yiw_shop_large_w() / (yiw_shop_thumbnail_w() + 18)))); $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) + 1 > $columns); if (empty($attachment_ids)) { return; } ?> <div class="thumbnails<?php echo $enable_slider ? ' slider' : ' noslider'; ?> "><?php echo '<ul class="yith_magnifier_gallery">'; $loop = 0; foreach ($attachment_ids as $attachment_id) { $classes = array(); if ($loop == 0 || $loop % $columns == 0) {