News:

Support the VirtueMart project and become a member

Main Menu

Strikethrough price in cart bug - Solution

Started by jjk, December 23, 2011, 14:29:01 PM

Previous topic - Next topic

jjk

I guess the strikethrough price problem is related to the following lines of ...\components\com_virtuemart\views\cart\tmpl\default_pricelist.php:

if (VmConfig::get('checkout_show_origprice',1) && !empty($this->cart->pricesUnformatted[$pkey]['basePriceWithTax']) && $prow->basePriceWithTax != $prow->salesPrice ) {echo '<span style="text-decoration:line-through">'.$prow->basePriceWithTax .'</span><br />' ;

The problem now appears to be that the "checkout_show_origprice" option is missing in the VM2 'Configuration - Checkout' tab, in the file virtuemart.cfg and therefore also in the database "config" table, which means it's always "On"
So, in order to get rid of it, we apparently need to add |checkout_show_origprice=s:1:"0";| into the database table field _virtuemart_configs - config.
-------------------
Also it seems that we need more options to display "discountAmount" and "subtotal_discount" (A "Show discount in cart" Yes/No option in Configuration) ;)

Additional Question: Is "automatic_shipping=1" in the config files still up to date? (Maybe it should read "automatic_shipment=1" meanwhile)
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

PRO

checkout_show_origprice

should be baseprice  ? right?

I originally thought the variable was wrong

jjk

#2
I think the orginal intention of this piece of code was simply to display a strikethrough price label like

$99.00
Now $45.50
Save 50%
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

Milbo

Quote from: jjk on December 23, 2011, 14:29:01 PM
The problem now appears to be that the "checkout_show_origprice" option is missing in the VM2 'Configuration -
good point, thx.

Quote from: jjk on December 23, 2011, 14:29:01 PM
Also it seems that we need more options to display "discountAmount" and "subtotal_discount" (A "Show discount in cart" Yes/No option in Configuration) ;)
Yes

Quote from: jjk on December 23, 2011, 14:29:01 PM
Additional Question: Is "automatic_shipping=1" in the config files still up to date? (Maybe it should read "automatic_shipment=1" meanwhile)

Should work, and should be set by default on true =1
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

AH

This variable appears not to be available in the current release 2.0.22d

Which prevents the removal of the strikethrough in cart/default_pricelist.php

VmConfig::get ('checkout_show_origprice')

Regards
A

Joomla 4.4.5
php 8.1

jjk

Quote from: Hutson on September 18, 2013, 10:05:41 AM
This variable appears not to be available in the current release 2.0.22d
Which prevents the removal of the strikethrough in cart/default_pricelist.php
VmConfig::get ('checkout_show_origprice')
It's still there, but there was a code change some time ago. So you might need a slightly different fix to hide it. See lines 155, 212, 215 (in my 2.0.22e version) in default_pricelist.php
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

AH

jjk

Thank you for the reply  but I am uncertain as to what you mean

QuoteIt's still there, but there was a code change some time ago. So you might need a slightly different fix to hide it. See lines 155, 212, 215 (in my 2.0.22e version) in default_pricelist.php

I cannot see a 2.0.22e version

Isnt the fix for this,  to include the configuration option in the admin price display settings and store in the relevant places in VM?

Happy to see what you have come up with though!




Regards
A

Joomla 4.4.5
php 8.1