Make sure src is not null
This commit is contained in:
parent
ad4704f02d
commit
c92d9d4a49
|
@ -528,7 +528,7 @@
|
||||||
$product_img_wrap = $product.find( '.woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image:eq(0)' ),
|
$product_img_wrap = $product.find( '.woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image:eq(0)' ),
|
||||||
$product_img = $product.find( '.woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image:eq(0) .wp-post-image' );
|
$product_img = $product.find( '.woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image:eq(0) .wp-post-image' );
|
||||||
|
|
||||||
if ( variation && variation.image && variation.image.src.length > 1 ) {
|
if ( variation && variation.image && variation.image.src && variation.image.src.length > 1 ) {
|
||||||
$product_img.wc_set_variation_attr( 'src', variation.image.src );
|
$product_img.wc_set_variation_attr( 'src', variation.image.src );
|
||||||
$product_img.wc_set_variation_attr( 'height', variation.image.src_h );
|
$product_img.wc_set_variation_attr( 'height', variation.image.src_h );
|
||||||
$product_img.wc_set_variation_attr( 'width', variation.image.src_w );
|
$product_img.wc_set_variation_attr( 'width', variation.image.src_w );
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue