Skip to content

Commit

Permalink
Merge pull request woocommerce#1018 from woocommerce/fix/1016
Browse files Browse the repository at this point in the history
Add missing WC functions file include
  • Loading branch information
tiagonoronha authored Dec 11, 2018
2 parents e3d5d0c + 62e2eeb commit 66e2202
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
1 change: 1 addition & 0 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@

require 'inc/woocommerce/storefront-woocommerce-template-hooks.php';
require 'inc/woocommerce/storefront-woocommerce-template-functions.php';
require 'inc/woocommerce/storefront-woocommerce-functions.php';
}

if ( is_admin() ) {
Expand Down
6 changes: 3 additions & 3 deletions inc/jetpack/class-storefront-jetpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,21 @@ public function jetpack_setup() {
public function jetpack_infinite_scroll_loop() {
do_action( 'storefront_jetpack_infinite_scroll_before' );

if ( storefront_is_product_archive() ) {
if ( function_exists( 'storefront_is_product_archive' ) && storefront_is_product_archive() ) {
do_action( 'storefront_jetpack_product_infinite_scroll_before' );
woocommerce_product_loop_start();
}

while ( have_posts() ) :
the_post();
if ( storefront_is_product_archive() ) {
if ( function_exists( 'storefront_is_product_archive' ) && storefront_is_product_archive() ) {
wc_get_template_part( 'content', 'product' );
} else {
get_template_part( 'content', get_post_format() );
}
endwhile; // end of the loop.

if ( storefront_is_product_archive() ) {
if ( function_exists( 'storefront_is_product_archive' ) && storefront_is_product_archive() ) {
woocommerce_product_loop_end();
do_action( 'storefront_jetpack_product_infinite_scroll_after' );
}
Expand Down
8 changes: 2 additions & 6 deletions inc/woocommerce/storefront-woocommerce-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,8 @@
* @return boolean
*/
function storefront_is_product_archive() {
if ( storefront_is_woocommerce_activated() ) {
if ( is_shop() || is_product_taxonomy() || is_product_category() || is_product_tag() ) {
return true;
} else {
return false;
}
if ( is_shop() || is_product_taxonomy() || is_product_category() || is_product_tag() ) {
return true;
} else {
return false;
}
Expand Down

0 comments on commit 66e2202

Please sign in to comment.