diff --git a/assets/js/frontend/single-product.js b/assets/js/frontend/single-product.js index e80b46711f8..c31fa2dc60b 100644 --- a/assets/js/frontend/single-product.js +++ b/assets/js/frontend/single-product.js @@ -44,7 +44,19 @@ jQuery( function( $ ) { } ) // Star ratings for comments .on( 'init', '#rating', function() { - $( '#rating' ).hide().before( '

12345

' ); + $( '#rating' ) + .hide() + .before( + '

\ + \ + 1\ + 2\ + 3\ + 4\ + 5\ + \ +

' + ); } ) .on( 'click', '#respond p.stars a', function() { var $star = $( this ), @@ -210,6 +222,12 @@ jQuery( function( $ ) { zoomTarget.trigger( 'zoom.destroy' ); zoomTarget.zoom( zoom_options ); + + setTimeout( function() { + if ( zoomTarget.find(':hover').length ) { + zoomTarget.trigger( 'mouseover' ); + } + }, 100 ); } }; @@ -307,12 +325,12 @@ jQuery( function( $ ) { * Initialize all galleries on page. */ $( '.woocommerce-product-gallery' ).each( function() { - + $( this ).trigger( 'wc-product-gallery-before-init', [ this, wc_single_product_params ] ); - + $( this ).wc_product_gallery( wc_single_product_params ); - + $( this ).trigger( 'wc-product-gallery-after-init', [ this, wc_single_product_params ] ); - + } ); } );