Merge pull request #29847 from codetot/fix/widget_products

Set loop prop to widget products to adapt condition on single product page
This commit is contained in:
Claudio Sanches 2021-05-17 12:40:05 -03:00 committed by GitHub
commit c35ed5e1a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -186,6 +186,8 @@ class WC_Widget_Products extends WC_Widget {
ob_start(); ob_start();
wc_set_loop_prop( 'name', 'widget' );
$products = $this->get_products( $args, $instance ); $products = $this->get_products( $args, $instance );
if ( $products && $products->have_posts() ) { if ( $products && $products->have_posts() ) {
$this->widget_start( $args, $instance ); $this->widget_start( $args, $instance );