示例#1
0
/**
 * Single Product Image
 *
 * @author 		WooThemes
 * @package 	WooCommerce/Templates
 * @version     2.0.14
 */
if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
global $post, $woocommerce, $product;
$attachment_ids = $product->get_gallery_attachment_ids();
if ($attachment_ids) {
    $gallerydata = jeg_get_gallery_product_data($post->ID);
    $overwritewidth = $gallerydata['product_fullwidth'];
    // resize image
    if ($overwritewidth) {
        $itemwidth = $gallerydata['product_width'];
        $itw = $itemwidth * 1.5;
        $ith = null;
        if ($gallerydata['gallery_layout'] == 'normal') {
            $ith = $itw * floatval($gallerydata['product_height']);
        } else {
            if ($gallerydata['gallery_layout'] === 'justified') {
                $ith = $gallerydata['justified_height'] * 1.5;
                $itw = null;
            }
        }
    }
 * Override this template by copying it to yourtheme/woocommerce/content-single-product.php
 *
 * @author 		WooThemes
 * @package 	WooCommerce/Templates
 * @version     1.6.4
 */
if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
remove_action('woocommerce_before_single_product_summary', 'woocommerce_show_product_sale_flash', 10);
remove_action('woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20);
?>

<?php 
$gallerydata = jeg_get_gallery_product_data(get_the_ID());
$overwritewidth = $gallerydata['product_fullwidth'];
$useisotope = 'isotopewrapper';
$additionalmarginclass = "nomargin";
$gallerylayout = '';
if ($overwritewidth) {
    $gallerylayout = $gallerydata['gallery_layout'] . "_layout";
    $usemargin = $gallerydata['user_margin'];
    $marginsize = 0;
    if ($usemargin) {
        $marginsize = $gallerydata['margin_size'];
        $paddingsize = 1 * $marginsize;
        $additionalmarginclass = "marginimg";
    }
} else {
    $useisotope = '';