News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

[SOLVED] "Show Tax in Cart" doesn't show tax in chart...

Started by gain, July 19, 2013, 18:24:05 PM

Previous topic - Next topic

gain

Hi,
I need to have tax in the cart, but the option in configuration panel seems not to work correctly cause the column in the cart appears, but always empty for products (not for total, screen attached).

I've done some debugging and I've noticed that in administrator/components/com_virtuemart/helpers/currencydisplay.php line 373 (createPriceDiv function) there is an if statement that prevents the print of the tax:
Quote[...]
                //This could be easily extended by product specific settings
                if(!empty($this->_priceConfig[$name][0])){
[...]

In my case $this->_priceConfig[$name][0] is zero (only for the tax print)... Is that right? Or is a product issue? Have I to check my products parameters?

Commenting the if statement seems to solve... but it's quite dangerous (even if Milbo say me it's safe! :P ).

Let me know if you need more details.

Any help would be appreciated.
Thanks in advance.

[attachment cleanup by admin]

Milbo

Looks for me like a custom layout, because the general tax is there.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

gain

My patch for making it works (also attached):

*** EDIT: THE PATCH IS WRONG cause shows taxamount in category list and productdetails also... :(

--- a/administrator/components/com_virtuemart/helpers/currencydisplay.php       2013-07-22 14:48:51.177353944 +0200
+++ b/administrator/components/com_virtuemart/helpers/currencydisplay.php       2013-07-22 14:42:58.301410636 +0200
@@ -370,7 +370,7 @@
                }^M
^M
                //This could be easily extended by product specific settings^M
-               if(!empty($this->_priceConfig[$name][0])){^M
+               if(!empty($this->_priceConfig[$name][0]) || $name == 'taxAmount'){^M
                        if(!empty($price) or $name == 'billTotal' or $name == 'billTaxAmount'){^M
                                $vis = "block";^M
                                $priceFormatted = $this->priceDisplay($price,0,(float)$quantity,false,$this->_priceConfig[$name][1],$name );^M


Hope it helps, breaking nothing... :|

Let me know if its ok.

PS: on my webserver $this->_priceConfig[$name][0] is zero, so empty is true and the if statement is not executed... maybe a php version issue? I don't think so... php.net (http://it2.php.net/empty) say that 0 is considered empty either as a string or as integer... any hint would be appreciated...

Milbo

disable the shoppergroup price display override.

Then post us a screenshot of your vm setting
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

gain

I've disabled the shoppergroup price override, but tax in cart are not visible again. The html span tag is empty (screen attached).

Price settings also attached... let me know if you need other settings...

Thanks

[attachment cleanup by admin]

gain


gain

I've understand the real problem only now.

VirtueMart allows you to show tax in products and not in cart, but not vice versa.

I'd thought that the Price Configuration > Show Tax in Cart option managed the entire visualization of the tax in cart, but that's not true: it managed the only column visualization instead!
If you enable it and not the Show Following Prices > Tax amount option, you'll have the colum in the cart but empty rows.

For a correct visualization you have to enable the Tax amount option too (see the attachment).

For hide the tax in products I've used this CSS:
div.browse-view div.PricetaxAmount,
div.productdetails div.PricetaxAmount {
  display: none !important;
}


[attachment cleanup by admin]