Wordpress Woocommerce精选图片被旧特色图片覆盖

时间:2013-10-16 11:03:11

标签: jquery wordpress woocommerce

这让我疯了:

我的woocommerce网上商店中的产品的新特色图片被已经从产品中删除的旧特色图片反复覆盖。 See Here

正确的图像加载,但后来被某个地方的jQuery函数覆盖,但我无法跟踪它。

如果我删除第一张图片,保存产品,添加新的精选图片,保存产品,第一张特色图片不会显示,但是因为我没有第一次这样做,所以初始图像被卡住了。我找不到wp_postmeta中与产品相关的两个_thumbnail_id行的证据。

让我疯狂......任何想法如何进一步解决这个问题?我试过禁用明显的插件和更新woocommerce,都无济于事。

这是生成图像的代码:

if ( has_post_thumbnail() ) {
    $image_title        = esc_attr( get_the_title( get_post_thumbnail_id() ) );
    $image_link         = wp_get_attachment_url( get_post_thumbnail_id() );
    $image              = get_the_post_thumbnail( $post->ID, apply_filters( 'single_product_large_thumbnail_size', 'shop_single' ), array('title' => $image_title) );
    $attachment_count   = count( $product->get_gallery_attachment_ids() );
    if ( $attachment_count > 0 ) {
        $gallery = '[product-gallery]';
    } else {
        $gallery = '';
    }

    echo apply_filters( 'woocommerce_single_product_image_html', sprintf( '<a href="%s" itemprop="image" class="woocommerce-main-image zoom" title="%s"  rel="prettyPhoto' . $gallery . '">%s</a>', $image_link, $image_title, $image ), $post->ID );

} else {

    echo apply_filters( 'woocommerce_single_product_image_html', sprintf( '<img src="%s" alt="Placeholder" />', woocommerce_placeholder_img_src() ), $post->ID );

}

0 个答案:

没有答案