Floating tax error with price ranges

  • Posts: 132
  • Thank you received: 2
9 years 9 months ago #190843

-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3.3.6

It seems that if you have activated the new floating tax feature, and have "Price Range" as price display option for product listing page, then HikaShop takes out a tax percentage on the product listing page. As soon as you click on one specific product, then the price is correct.

For rexample:
1. Product costs 100€ (final price incl taxes) and tax is calculated during checkout depending on user location
2. If option "Price range" is selected for display of product listing, then the price shown in the list of products becomes 100€ minus tax (80€ for example).
3. Click on product in question, and the price on the product details page is as expected (i.e. including tax)

Last edit: 9 years 9 months ago by earmaster.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
9 years 9 months ago #191193

HI,

Thank you for your feedback.
We were able to reproduce the issue and fix it.

Change the code:

$min->price_value_with_tax = $this->getTaxedPrice($min->price_value,$zone_id,$element->product_tax_id);
								$min->taxes = $this->taxRates;
								$max->price_value_with_tax = $this->getTaxedPrice($max->price_value,$zone_id,$element->product_tax_id);
								$max->taxes = $this->taxRates;
to:
if(empty($min->taxes_added)){
								$min->price_value_with_tax = $this->getTaxedPrice($min->price_value,$zone_id,$element->product_tax_id);
								$min->taxes = $this->taxRates;
								$min->taxes_added = true;
							}
							if(empty($max->taxes_added)){
								$max->price_value_with_tax = $this->getTaxedPrice($max->price_value,$zone_id,$element->product_tax_id);
								$max->taxes = $this->taxRates;
								$max->taxes_added = true;
							}
in the file administrator/components/com_hikashop/classes/currency.php and that should fix the problem.

The following user(s) said Thank You: earmaster

Please Log in or Create an account to join the conversation.

  • Posts: 132
  • Thank you received: 2
9 years 9 months ago #191293

Thanks a lot Nicolas, that fixed the problem on the products list page indeed!
It seems though that products with price ranges (one price per variant) still show the wrong price once put into the cart.

Last edit: 9 years 9 months ago by earmaster. Reason: typo

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
9 years 9 months ago #191342

Hi,

Change the code:

				$price->price_value_with_tax = $this->getTaxedPrice($price->price_value,$zone_id,$product_tax_id,$round);
				$price->taxes = $this->taxRates;
to:
				if(empty($price->taxes_added)){
					$price->price_value_with_tax = $this->getTaxedPrice($price->price_value,$zone_id,$product_tax_id,$round);
					$price->taxes_added = true;
					$price->taxes = $this->taxRates;
				}
in the same file and that should fix the problem.

The following user(s) said Thank You: earmaster

Please Log in or Create an account to join the conversation.

  • Posts: 132
  • Thank you received: 2
9 years 9 months ago #191448

That was fast. It's perfect, thank you! That fixed it.

Please Log in or Create an account to join the conversation.

Time to create page: 0.065 seconds
Powered by Kunena Forum