News:

Support the VirtueMart project and become a member

Main Menu

Tax on shipping cost - label issue on cart

Started by antonitus, April 25, 2016, 10:46:53 AM

Previous topic - Next topic

antonitus

I have an issue with the labels on the cart. My scenario:
1. Added a shipping rule
2. Added a shipping tax rule (separate rule to my other tax rules)
3. Applied this shipping tax rule to the shipping rule

All the tax works out well on the cart., however when I view the cart, it adds a label called 'SHIPPING' which was taken straight from the label name of the shipping tax rule. It also replaces the normal 'TAX' label to '20%' (see 1st picture) Something seriously is wrong here, probably a bug. When I removed the shipping tax rule from the shipping rule, the label reverts back to the normal 'TAX' label (see 2nd picture).

Can somebody please tell me what might be happening here?  I changed the template to another template and the issue still exists so it is not a template issue.  I have another website with another template and I am using the exact same Virtuemart V3.0.16 and everything seems to be ok there. I upgraded that version about 2 weeks ago and the issue I am getting on the new website was upgraded yesterday, so has anything changed on that upgrade since 2 or 3 weeks ago without a version number update?

Regards,
antonitus
Joomla V3.5.1
Virtuemart V3.0.16

GJC Web Design

this comes from

components\com_virtuemart\views\cart\tmpl\default_pricelist.php

<?php if (VmConfig::get ('show_tax')) {
      $tax = vmText::_ ('COM_VIRTUEMART_CART_SUBTOTAL_TAX_AMOUNT');
      if(!empty($this->cart->cartData['VatTax'])){
         if(count($this->cart->cartData['VatTax']) < 2) {
            reset($this->cart->cartData['VatTax']);
            $taxd = current($this->cart->cartData['VatTax']);
            $tax = shopFunctionsF::getTaxNameWithValue($taxd['calc_name'],$taxd['calc_value']);
         }
      }
      ?>
   <th class="vm-cart-item-tax" ><?php echo "<span  class='priceColor2'>" . $tax . '</span>' ?></th>

A step too far I feel

you can replace with

<th class="vm-cart-item-tax" ><?php echo "<span  class='priceColor2'>" . vmText::_ ('COM_VIRTUEMART_CART_SUBTOTAL_TAX_AMOUNT'); . '</span>' ?></th>
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

antonitus

Hi GJC Web Design,

Thanks for your help again.  What I'm worried about is changing the script and then having to change it again when an update occurs.  I can of course add an override of course. My main concern is why is this happening to the update of Virtuemart I did yesterday and not to the update I did 2-3 weeks ago under the same version number.  I think Virtuemart must have changed something without changing the version number.
Joomla V3.5.1
Virtuemart V3.0.16

GJC Web Design

no idea.. from memory this has been there since 3.0.12 ..

what's the prob with an over ride? 5 mins work at most
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

antonitus

True. I'm doing it right now as I'm writing this. In fact, the override file is there already, I just have to edit the code you sent me. So thank you for that.
Joomla V3.5.1
Virtuemart V3.0.16

antonitus

I removed this code from 'templates/template_name/layouts/default/html/com_virtuemart/cart/default_pricelist.php' (override file already existed)

if (VmConfig::get ('show_tax') && !empty($this->cart->cartData['VatTax']))
{
reset($this->cart->cartData['VatTax']);
$taxd = current($this->cart->cartData['VatTax']);
$taxTitle = $taxd['calc_name'] . ' ' . rtrim(trim($taxd['calc_value'],'0'), '.') . '%';
}


This worked a treat and now those unwanted labels have been removed and it's back to the normal 'Tax' label.  Maybe Virtuemart should have an option to amend this in the config file or shipping rule in the future.
Joomla V3.5.1
Virtuemart V3.0.16