diff --git a/changelog.md b/changelog.md index e9e7cd0..2cd0336 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,16 @@ # Reykjavik Changelog +## 1.0.6 + +* **Fix**: WooCommerce 3.3- backwards compatibility + +### Files changed: + + changelog.md + style.css + includes/plugins/woocommerce/class-woocommerce-loop.php + + ## 1.0.5 * **Add**: Compatibility with WooCommerce 3.3 product grid options diff --git a/includes/plugins/woocommerce/class-woocommerce-loop.php b/includes/plugins/woocommerce/class-woocommerce-loop.php index 237e830..91efe38 100644 --- a/includes/plugins/woocommerce/class-woocommerce-loop.php +++ b/includes/plugins/woocommerce/class-woocommerce-loop.php @@ -6,7 +6,7 @@ * @copyright WebMan Design, Oliver Juhas * * @since 1.0.0 - * @version 1.0.5 + * @version 1.0.6 * * Contents: * @@ -330,16 +330,13 @@ public static function active_filters() { * Pagination * * @since 1.0.0 - * @version 1.0.5 + * @version 1.0.6 */ public static function pagination() { // Requirements check - if ( - ! function_exists( 'woocommerce_pagination' ) - || ! function_exists( 'wc_get_loop_prop' ) - ) { + if ( ! function_exists( 'woocommerce_pagination' ) ) { return; } @@ -349,9 +346,19 @@ public static function pagination() { ob_start(); woocommerce_pagination(); + if ( function_exists( 'wc_get_loop_prop' ) ) { + $total = wc_get_loop_prop( 'total_pages' ); + $current = wc_get_loop_prop( 'current_page' ); + } else { + // WooCommerce 3.3- backwards compatibility + global $wp_query; + $total = ( isset( $wp_query->max_num_pages ) ) ? ( $wp_query->max_num_pages ) : ( 1 ); + $current = ( get_query_var( 'paged' ) ) ? ( absint( get_query_var( 'paged' ) ) ) : ( 1 ); + } + $html = str_replace( '