VirtueMart 3.0.8, Joomla 3.4.1
I've got the following order
Item | Ex Tax Price | Tax | Row Total |
Product A | 500 EUR | 115 EUR | 615 EUR |
Product B | 500 EUR | 115 EUR | 615 EUR |
Subtotal | 1000 EUR | 230 EUR | 1230 EUR |
Shipping | 100 EUR | 23 EUR | 123 EUR |
Total | 1100 EUR | 253 EUR | 1353 EUR |
All is good and this is supported by the following variable values
$this->cart->cartPrices['basePrice'] | 1000 |
$this->cart->cartPrices['taxAmount'] | 230 |
$this->cart->cartPrices['salesPrice'] | 1230 |
$this->cart->cartPrices['shipmentValue'] | 100 |
$this->cart->cartPrices['shipmentTax'] | 23 |
$this->cart->cartPrices['salesPriceShipment'] | 123 |
$this->cart->cartPrices['billTaxAmount'] | 253 |
$this->cart->cartPrices['billtotal'] | 1353 |
I have the following coupon defined, which should give the shopper 10% off their order
Coupon | MYCOUPON |
Value | 10.00000 |
Percentage or Total | Percent |
Coupon Type | Permanent Coupon |
Minimum total Order | 0.00000 |
Coupon Start Date | - Never - |
Coupon Expiry Date | some time in future |
when I apply the coupon to the order I would expect this (My testing shows that the discount is a percentage of the subtotal, so doesn't include the shipping costs)
Item | Ex Tax Price | Tax | Row Total |
Product A | 500 EUR | 115 EUR | 615 EUR |
Product B | 500 EUR | 115 EUR | 615 EUR |
Subtotal | 1000 EUR | 230 EUR | 1230 EUR |
Shipping | 100 EUR | 23 EUR | 123 EUR |
Coupon | -100 EUR | -23 EUR | -123 EUR |
Total | 1000 EUR | 230 EUR | 1230 EUR |
When I look at the cart on screen and the variables that support this, it doesn't look quite right
$this->cart->cartPrices['basePrice'] | 1000 |
$this->cart->cartPrices['taxAmount'] | 230 |
$this->cart->cartPrices['salesPrice'] | 1230 |
$this->cart->cartPrices['shipmentValue'] | 100 |
$this->cart->cartPrices['shipmentTax'] | 23 |
$this->cart->cartPrices['salesPriceShipment'] | 123 |
$this->cart->cartPrices['couponTax'] | 0 |
$this->cart->cartPrices['salesPriceCoupon'] | -123 |
$this->cart->cartPrices['billTaxAmount'] | 228.13 |
$this->cart->cartPrices['billtotal'] | 1230 |
The value of 228.13 for $this->cart->cartPrices['billTaxAmount'] was initially a bit puzzling, but it turns out that it is the tax based on a bill total of $1220. i.e. it looks like the discount might be applied twice, once as a percentage and once as an absolute value. Well at least for the purpose of calculating the billTaxAmount.