When a product has a tax rate applied to it, after modifying an attribute selection the price is updated to include the tax even if the tax was already factored into the price for the original display.
This was caused by a partial edit to the includes/classes/dynamic_price_updater.php file in the prepareOutput function, line 116. The desire was to setup a way to return both prices of including and excluding the tax to be handled/managed as necessary in the javascript. Problem is that the operation as modified only accurately supported adding tax when the cart was set to not display tax on the store side, but then that one "difference" causes other issues.
The other "reason" for this being an issue is that the price as returned by this class is determined by the result(s) of a temporary shopping cart, such that the calculated price is the cost associated with the on screen quantity of product without consideration of the quantity in the cart. For this issue, basically stating that if the catalog side is to display the price's item with tax, then the shopping cart price would already include the tax price and no further/additional tax would be necessary. If the catalog were to display price without tax, then same thing no modification of the price is necessary to show the product's price.
Therefore, the solution to this is to basically restore line 116 from:
$this->responseText['priceTotal'] .= $currencies->display_price($this->shoppingCart->total, zen_get_tax_rate($product_check->fields['products_tax_class_id'])/* 0 */ /* DISPLAY_PRICE_WITH_TAX */);
Back to:
$this->responseText['priceTotal'] .= $currencies->display_price($this->shoppingCart->total, 0/* 0 */ /* DISPLAY_PRICE_WITH_TAX */);
Further development/coding needed to support returning both inc/exc prices either by using/reusing an existing plugin that is installed or incorporating the code from that plugin to here so that there is no dependency on it. Likely would consider adding two additional responseText fields, priceTaxInc
and priceTaxExc
.