Author Topic: Last product added in cart overwrite category's tax  (Read 1038 times)

xvapolh

  • Beginner
  • *
  • Posts: 9
  • A beginner
Last product added in cart overwrite category's tax
« on: July 01, 2019, 17:24:23 pm »
VirtueMart 3.4.2 - Joomla! 3.9.8 - php 7.2.10

I've a "+60€ tax" in an event category : if i buy one or more product of this category, a DBTaxBill is created with +60€ in my cart. It works fine.
But if I add another product to my cart, like a book, the tax is overwriten and no tax appears.

I tried by creating a "0 € tax" for books, but this "0 € tax" stays as the last tax, when a book is the latest added product of the cart.
If i had another product of my event as a "last cart product", the "+60€ tax" appears.

Thanks

xvapolh

  • Beginner
  • *
  • Posts: 9
  • A beginner
Re: Last product added in cart overwrite category's tax
« Reply #1 on: July 05, 2019, 09:52:58 am »
With captures :


See my problem ?

jjk

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3534
  • using Matomo instead of Google Analytics
Re: Last product added in cart overwrite category's tax
« Reply #2 on: July 05, 2019, 10:32:10 am »
If you are located in the EU, your tax configuration might not be allowed. Which country's tax rules are applicable in your case?
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

xvapolh

  • Beginner
  • *
  • Posts: 9
  • A beginner
Re: Last product added in cart overwrite category's tax
« Reply #3 on: July 05, 2019, 10:37:30 am »
There's no country's tax rules. Just a category tax rules. Same rule for all country : if you take an event, it's +60€ on the bill.

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4046
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Last product added in cart overwrite category's tax
« Reply #4 on: July 05, 2019, 11:22:52 am »
And when you set it as a Vat tax (product)?
TaxBill is for all the bill, so it can change depending the cart content.

xvapolh

  • Beginner
  • *
  • Posts: 9
  • A beginner
Re: Last product added in cart overwrite category's tax
« Reply #5 on: July 05, 2019, 11:25:37 am »
It costs 60€ per product, not for the category.

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4046
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Last product added in cart overwrite category's tax
« Reply #6 on: July 05, 2019, 13:00:20 pm »
switch "DBTaxBill" to "VatTax" and check if it work

xvapolh

  • Beginner
  • *
  • Posts: 9
  • A beginner
Re: Last product added in cart overwrite category's tax
« Reply #7 on: July 09, 2019, 09:12:12 am »
There it is.

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4046
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Last product added in cart overwrite category's tax
« Reply #8 on: July 09, 2019, 13:06:21 pm »
So does it work or not ?
Because you have so many calculated thinks, that it's hard to know(shipment tax + reduction + product taxes)

xvapolh

  • Beginner
  • *
  • Posts: 9
  • A beginner
Re: Last product added in cart overwrite category's tax
« Reply #9 on: July 09, 2019, 13:31:17 pm »
It doesn't work. It put +60€ on each product of the category. I want +60€ once, for all the category (one or multi products added to cart).

My problem is : "why my +60€ tax (in one category) is overwrited by other category products, if they appears in the last position in cart ?

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4046
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Last product added in cart overwrite category's tax
« Reply #10 on: July 09, 2019, 13:42:53 pm »
Because the tax per bill check the rules in a product order then set it in the cart.
If you need specific rules, you have to create your own tax plugin.

xvapolh

  • Beginner
  • *
  • Posts: 9
  • A beginner
Re: Last product added in cart overwrite category's tax
« Reply #11 on: July 11, 2019, 17:12:11 pm »
Is there a possibility in calculationh.php to sum all the rules ?

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4046
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Last product added in cart overwrite category's tax
« Reply #12 on: July 11, 2019, 23:13:33 pm »
Do your own tax plugin. You can then do anything as you want.
You dont need to hack the core

xvapolh

  • Beginner
  • *
  • Posts: 9
  • A beginner
Re: Last product added in cart overwrite category's tax
« Reply #13 on: July 17, 2019, 12:12:20 pm »
Maybe there is a way to display my products by reference, in order to put them at the bottom of the cart ?

xvapolh

  • Beginner
  • *
  • Posts: 9
  • A beginner
Re: Last product added in cart overwrite category's tax
« Reply #14 on: August 20, 2019, 09:28:53 am »
Any idea to display the products by reference (sku) in cart ?