Jump to content

[Solved] Discounted price error when logged in from taxable state


Recommended Posts

A strange thing is happening to our prices when a customer is logged in from the state that we charge sales tax to, but only if the product price is discounted.

Site is set up for 8.75% tax for California residents only and Customers > Groups > Default > is set to tax excluded

All prices show correctly (tax excluded) when not logged in or customer is from another state.

But, when customers log in from a California address, although products that are at the regular price show the correct price, discounted products show incorrect prices. Both say (tax excl.).

For example all items that are on sale for $39.95 (regular $59.95) display as $41.56, so $1.61 is being added on. The tax would be $3.50, so it is not the tax. They both say tax excl.

Oddly the items that are on sale for $54.95 (also regular $59.95) only have .40 added on, so display at $55.35.

It almost (but not exactly) works out to be that it is adding the amount of a tax for the difference in the sale price to the regular price. ie. product * tax - discount rather than product - discount * tax.

If a product is added to the shopping cart it adds the tax on top of the incorrect price:
example:
Product: 41.56
Shipping: 6.00
Tax: 3.64
Total: 45.20

When it should be:
Product: 39.95
Shipping: 6.00
Tax: 3.50
Total: 43.45

I'm using version 1.4.0.17

How can I fix this?

Here is a Link to Site but we do not currently have the shop enabled.

Thank You!

Link to comment
Share on other sites

Please help. Prices are wrong. Our store is delayed from going live. Can anyone contact me about fixing this?

If a customer logs in from California (where we collect Sales tax) a random amount is being applied to the product price.

Product price in example should be 34.95.

45574_4xkIJ0kpxSlORn1hh68c_t

Link to comment
Share on other sites

I have pinpointed the error. Well, it wasn't really an error, but the code helped me pinpoint it. The code is in Product.php somewhere near line 1800

The reduc variable was (I thought) calculating incorrectly.

if ($specific_price['reduction_type'] == 'amount')
{    
    if (!$specific_price['id_currency'])
    {
    $reduction_amount = Tools::convertPrice($reduction_amount, $id_currency);
    // the $reduction_amount above is correct at 20.00

    $reduc = Tools::ps_round(!$use_tax ? $reduction_amount / (1 + $tax_rate / 100) : $reduction_amount, 2);
    // $reduc result is $18.39 and is discounting the shoe by $18.39, when it should be discounting it by $20.00
}



What I noticed was that these two if clause were triggered if the reduction type was "amount" and there was no specific currency selected, so I went into the BO and sure enough, I had not specified Dollar. It was set to all countries, -- but that still didn't fix the problem -- then I realized I didn't need to use a reduction amount, I could simply put the sale price in the price field.. That's what solved the problem!

I have no idea why a reduction amount is affected by tax. I imagine it must be needed for some countries or situations, but it sure threw me!!

Link to comment
Share on other sites

  • 1 month later...

The original price is preserved on the main page for the item under pre-tax retail price. So, this works in our case. We input temporary price reductions by going to the prices page and adding a new specific price. You can even put in the dates that the reduced price is effective.

I guess if you want a retail price listed, and you have a "normal" sales price, then want a temporary price reduction on top of that it might be a different story. But I would experiment with an additional "new specific price" for a set time period to see if that works for you. I have not tried it.

For us it was just a matter of using the "Product price (tax excl.):" field instead of the "Apply a discount of:" field, as the second option messed up the taxes.

48309_KXhkX6PLvWZnUlnRPwlB_t

Link to comment
Share on other sites

  • 2 weeks later...

I just got done doing a update 1.3.X to 1.4.3 and I have this same issue. Thank you kallym for this work around as i was pulling my hair out for hours with this issue as the PayPal module when you go to check out has a different amount as well. So if you have a product that is onsale and has tax when using the discount amount the total gets all fobar. If i fallow what kallym suggested it seems that everything is ok.

As i did a upgrade so i now have to go back and redo 800 + products that are onsale using discount amount. :-( . I love all the 1.4.X features and I am very excited about the 1.5 multi store stuff, but it would be GREAT if there was another fix for the tax, sale price issue so i would not have to change all my products manual.

If there is anything i can provide to help please let me know.

Link to comment
Share on other sites

  • 9 months later...

Hello, my shop are using Prestashop 1.4.7 (with some files of 1.4.7.3) but actually fails in the price of the product. Example (I using only 7% in New Jersey):

 

Guitar original price: 399$

Discount amount: 100$

Guitar with discount: 299$

 

===============

User outside of NJ

===============

Guitar with discount 299$

=========

User of NJ

=========

Guitar with discount 305.54$

 

If in the discount amount put 107$, the price of users of New Jersey is ok, but the others shows 292$ (299$-107$)

 

How I can solve this problem?

 

Thanks in advance, best regards.

Link to comment
Share on other sites

  • 4 weeks later...

I have the same issue that Zeyckler described above. Is there a place (bug tracker, forum threat) with the solution. I have been looking in the forums but information is mixed with other fixes.

 

Using V 1.4.6.2

 

Thank you,

 

P.

Edited by pietro (see edit history)
Link to comment
Share on other sites

  • 10 months later...
×
×
  • Create New...