diff --git a/doofinder-for-woocommerce/doofinder-for-woocommerce.php b/doofinder-for-woocommerce/doofinder-for-woocommerce.php index edbe7ae..5001ddc 100644 --- a/doofinder-for-woocommerce/doofinder-for-woocommerce.php +++ b/doofinder-for-woocommerce/doofinder-for-woocommerce.php @@ -3,7 +3,7 @@ * Plugin Name: DOOFINDER Search and Discovery for WP & WooCommerce * License: GPLv2 or later * License URI: http://www.gnu.org/licenses/gpl-2.0.html - * Version: 2.5.20 + * Version: 2.5.21 * Requires at least: 5.6 * Requires PHP: 7.0 * Author: Doofinder diff --git a/doofinder-for-woocommerce/includes/api/endpoints/class-endpoint-product.php b/doofinder-for-woocommerce/includes/api/endpoints/class-endpoint-product.php index ca7e05c..c06073b 100644 --- a/doofinder-for-woocommerce/includes/api/endpoints/class-endpoint-product.php +++ b/doofinder-for-woocommerce/includes/api/endpoints/class-endpoint-product.php @@ -437,7 +437,8 @@ private static function format_prices( $product ) { $sale_price = self::get_sale_price( $wc_product ); $product['regular_price'] = $regular_price; - $product['price'] = '' === (string) $regular_price ? $price : $regular_price; + // In some niche cases, we receive a regular_price of 0 but it is not the real regular_price. + $product['price'] = '' === (string) $regular_price || 0 == $regular_price ? $price : $regular_price; $final_sale_price = '' === (string) $sale_price || $price < $regular_price ? $price : $sale_price; if ( empty( $final_sale_price ) || $final_sale_price === $regular_price ) { diff --git a/doofinder-for-woocommerce/readme.txt b/doofinder-for-woocommerce/readme.txt index b4549de..b8ddc05 100644 --- a/doofinder-for-woocommerce/readme.txt +++ b/doofinder-for-woocommerce/readme.txt @@ -1,11 +1,11 @@ === DOOFINDER Search and Discovery for WP & WooCommerce === Contributors: Doofinder Tags: search, autocomplete -Version: 2.5.20 +Version: 2.5.21 Requires at least: 5.6 Tested up to: 6.7.1 Requires PHP: 7.0 -Stable tag: 2.5.20 +Stable tag: 2.5.21 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -126,6 +126,9 @@ You can report security bugs through the Patchstack Vulnerability Disclosure Pro == Changelog == += 2.5.21 = +- Avoid setting a price of 0 when the regular price is 0. + = 2.5.20 = - Prevented an error when the $image_sizes array is not initialized. diff --git a/package-lock.json b/package-lock.json index aae828a..b92f84e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "doofinder-woocommerce", - "version": "2.5.20", + "version": "2.5.21", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "doofinder-woocommerce", - "version": "2.5.20", + "version": "2.5.21", "license": "MIT", "devDependencies": { "grunt": "^1.0.1", diff --git a/package.json b/package.json index f905520..596376b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "doofinder-woocommerce", - "version": "2.5.20", + "version": "2.5.21", "description": "Integrate Doofinder in your WooCommerce site with (almost) no effort.", "main": "index.js", "scripts": {