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!