News:

Looking for documentation? Take a look on our wiki

Main Menu

tax of shipping and payment depends on tax-rates in cart?

Started by Mojo78, October 09, 2012, 11:20:22 AM

Previous topic - Next topic

Mojo78

Hi,
this is my first post here so i want to introduce myself:
I am Jörg, 33 years old from germany. Currently i'm migrating my old virtuemart webshop to vm 2.

I have following problem in virtuemart 2:
I want the vat of shipping and payment to be the same as the taxrate of the products with the highest value.

For Instance:
supposed i have a product with VAT 7% in cart ->  VAT of shipping and payment: 7%
supposed i have a product with VAT 19% in cart ->  VAT of shipping and payment: 19%
supposed i have a product with VAT 7% for 100,-€ and one with VAT 19% for 120,-€ in cart ->  VAT of shipping and payment: 19%
supposed i have a product with VAT 7% for 120,-€ and one with VAT 19% for 100,-€ in cart ->  VAT of shipping and payment: 7%

This is a common problem in germany. Perhaps does s.o. here know how to solve it?
I think you cannot solve this with the standard- built-in payment / shipping plugins. My first idea was to create a custom calculation - plugin... but i searched and can't even find one calculation-plugin I could use as sample. Or some kind of tutorial how to build a calculation-plugin or something.
I wasted 2 hours today and i hope s.o here has an idea.

Many thanks in advance!
Ciao, Mojo





Mojo78

...i tested today with a self-written shipment plugin. but i think, i can't handle my problem with a shipment-plugin. i tried to use plgVmOnShipperSelectedCalculatePrice to do the job, but i think it is simply not fired, when the shipment-plugin ist not selected.

i also tried to write a calculation-plugin. that didnt work, too.

is there a way to create a plugin in which i can use an event that fires, when the shopping-cart ist called (or better when the prices of shipment and payment are calculated), so that i can change the va-tax of shipping and payment before it is displayed?

i would be very grateful for every answer.
Bye Mojo








alatak

Hello

QuoteplgVmOnShipperSelectedCalculatePrice to do the job, but i think it is simply not fired, when the shipment-plugin ist not selected.

The wiki is unfortunatly not up to date.
The trigger is this one
Quotepublic function plgVmonSelectedCalculatePriceShipment (VirtueMartCart $cart, array &$cart_prices, &$cart_prices_name) {