Have you configured the Tax options recently, or were they established prior to activating our plugin?
Please share a screenshot of the Price History tab within the product edit section. I’d like to examine the price history table specifically for that product.
Thank you.
Tax options haven’t been touched since plugin installation, so they were established prior to activating the plugin.
Price History for this product says:
“No pricing data recorded since plugin activation – This message indicates that no pricing data has been saved in the database since the activation of the plugin. This can occur if the plugin was recently installed or if the product price has not changed since the activation of the plugin.”
The problem only seems to occur in Variable Products. Simple products don’t have the problem.
Here is an example of a simple product, where the lowest price is as expected: https://www.yozendesign.com/tuote/art-deco-nappikorvakorut-viininpunainen/
Which options have you enabled in the Lowest Price module?
Absolutely spot on! There’s indeed a bug, and it only pops up when there are fewer than two price changes with the “inherit from regular price” option enabled. No worries, though – we’ve identified the issue, and it’s set to be patched in the next plugin release, due in the next few days.
In the meantime, you can use the following code snippet in your functions.php or a PHP snippets plugin to prevent the double tax calculation:
add_filter('pph_lowest_price', function ($lowest_price, $product_id, $product) {
$inherit_regular = DEVNET_PPH_OPTIONS['lowest_price']['inherit_regular'] ?? true;
if ($inherit_regular) {
$entries = Devnet\PPH\Includes\Helper::get_price_history($product_id, false);
$entries_count = count($entries);
if (empty($entries) || $entries_count === 1) {
if ($product->get_type() === 'variable') {
$lowest_price = $product->get_variation_regular_price('max', false);
}
}
}
return $lowest_price;
}, 10, 3);
Just a heads-up: once you’ve updated the plugin to the new version, feel free to remove the above code snippet.
Big thanks for bringing this bug to our attention! We appreciate your help in making our plugin even better.
Cheers!
Thanks for your super quick response, and for the fix! After applying the fix, it works as expected.
Thank you!
Great! I’m glad that I was able to help you. 🙂 If you find the plugin handy and feel like sharing your thoughts, leaving a review would be awesome. Your input is truly appreciated!