diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 95a917a..48769b2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,7 @@ on: push: branches: - 1.x + - 2.x permissions: contents: write diff --git a/defaults/archive-product.twig b/defaults/archive-product.twig index 3cdb59a..19419f4 100644 --- a/defaults/archive-product.twig +++ b/defaults/archive-product.twig @@ -32,7 +32,7 @@ {% if fn('woocommerce_product_loop') %} {# - # woocommerce_before_shop_loop hook. + # Hook: woocommerce_before_shop_loop. # # @hooked woocommerce_output_all_notices - 10 # @hooked woocommerce_result_count - 20 @@ -50,6 +50,11 @@ # calling `have_posts()`, we check if there are posts we can display. #} {% if fn('have_posts') %} + {## + # Hook: woocommerce_shop_loop. + #} + {% do action('woocommerce_shop_loop') %} + {{ fn('wc_get_template_part', 'content', 'product' ) }} {% endif %} {% endfor %} diff --git a/lib/Product.php b/lib/Product.php index 023da56..85c7084 100644 --- a/lib/Product.php +++ b/lib/Product.php @@ -64,16 +64,6 @@ public static function build( WP_Post $wp_post): static { return $post; } - public function setup() { - parent::setup(); - - if ( ! is_singular( 'product' ) && did_action( 'woocommerce_before_shop_loop' ) > 0 ) { - do_action( 'woocommerce_shop_loop' ); - } - - return $this; - } - /** * Get the first assigned product category. *