I'm trying to make some changes to the VM Shopping Cart module that I display on all pages of my site http://www.signdoctor.co.uk. What I want to dipaly is the total number of products and the total price without tax (UK VAT). I can get the total number as '$data->totalProductTxt' easily but can't seem to get the correct price total! The only value that seems to be populated is '$data->billTotal' and this includes tax. Anyone know if this is possible??
Does no-one know the answer to this?????
I am now working with 2.9.9 but this should be very similare for your version (although you have not stated what that is, which is why you have few replies!!!)
The data is prepared by
function
function prepareAjaxData($checkAutomaticSelected=true){
in
components\com_virtuemart\helpers\cart.php
Looks like have to do a core adjustment, this will get overwritten when you upgrade (Not sure why both VAT and ex_vat are not passed to the template as it provides both at a product level
$data->billTotal = $currencyDisplay->priceDisplay( $this->cartPrices['billTotal'] );
//Provide ex-vat price as well
$data->billTotal_net = $currencyDisplay->priceDisplay( $this->cartPrices['discountedPriceWithoutTax'] );
Now you can now create a template override for your mini cart For the cart total
'billtotal_net'
<?php echo $data->billTotal_net; ?>
Unfortunately this breaks my site (Joomla 2.5.27; VM 2.6.10) :(
OK, fixed it now :D
If anyone else needs it, the working code for VM 2.6.10 is:
$this->data->billTotal = $currency->priceDisplay( $this->pricesUnformatted['billTotal'] );
//Provide ex-vat price as well
$this->data->billTotal_net = $currency->priceDisplay( $this->pricesUnformatted['discountedPriceWithoutTax'] );
Good to know you got it working for 2.6.10
I did not have the time to look into the exact coding for that version - but thanks for letting others know your solution