Virtuemart Pricing

Chrisnz
39 Posts
Chrisnz posted this 31 May 2016

I can't see how to display the discount amount on the products or products detail layouts in Virtuemart.
The product sale icon doesn't show either

I can't see how to display the discount amount on the products or products detail layouts in Virtuemart. The product sale icon doesn't show either
Vote to pay developers attention to this features or issue.
12 Comments
Order By: Standard | Newest
Support Team
Support Team posted this 01 June 2016

Hello,

To show discount, please use this CMS Code:
http://answers.themler.com/articles/67028/tips-and-tricks#t_8

Please make sure to have the corresponding control added to Products and Product Details template:
Products >> Add Control >> Product Sale, or Product Details >> Add Control >> Product Sale.

Sincerely,
Nettie,
BillionDigital Team

Hello, To show discount, please use this CMS Code: http://answers.themler.com/articles/67028/tips-and-tricks#t_8 Please make sure to have the corresponding control added to Products and Product Details template: Products >> Add Control >> Product Sale, or Product Details >> Add Control >> Product Sale. Sincerely, Nettie, BillionDigital Team
Chrisnz
39 Posts
Chrisnz posted this 01 June 2016

Thanks for that. Is there a way to show the base price with tax, but only if the product has a discount applied?
i.e. so you can show was $... now $...

Thanks for that. Is there a way to show the base price with tax, but only if the product has a discount applied? i.e. so you can show was $... now $...
Support Team
Support Team posted this 02 June 2016

Hello,

In Themler Products tab >> Product Price there is an option Show Old Price, if enabled, it shows the old price besides the final one.

Sincerely,
Nettie,
BillionDigital Team

Hello, In Themler Products tab >> Product Price there is an option Show Old Price, if enabled, it shows the old price besides the final one. Sincerely, Nettie, BillionDigital Team
Chrisnz
39 Posts
Chrisnz posted this 02 June 2016

Yes, that shows the original price without tax. I need it to show the old price with tax and only be displayed if the product is discounted. It actually displays correctly in the shopping cart.

I've attached how the pricing looked using the original template and how it looks using themler.
I need to configure the prices the same as previously.

Before: (prices displayed correctly)

Screen-Shot-2016-06-03-at-7.58.43-AM.png

With Themler: (old price without tax. Old price should not display on 2nd product)

Screen-Shot-2016-06-03-at-8.05.52-AM.png

Shopping cart (Prices displayed correctly)

Screen-Shot-2016-06-03-at-8.15.48-AM.png

Yes, that shows the original price **without** tax. I need it to show the old price **with tax** and only be displayed if the product is discounted. It actually displays correctly in the shopping cart. I've attached how the pricing looked using the original template and how it looks using themler. I need to configure the prices the same as previously. **Before: (prices displayed correctly)** !Screen-Shot-2016-06-03-at-7.58.43-AM.png! **With Themler: (old price without tax. Old price should not display on 2nd product)** !Screen-Shot-2016-06-03-at-8.05.52-AM.png! **Shopping cart (Prices displayed correctly)** !Screen-Shot-2016-06-03-at-8.15.48-AM.png!

Last edited 02 June 2016 by Chrisnz

artur.dulian
19 Posts
artur.dulian posted this 06 June 2016

I alsou want to show old price, not base price wibout tax....

I alsou want to show old price, not base price wibout tax....
artur.dulian
19 Posts
artur.dulian posted this 06 June 2016

I find some solution, pleas check is this work for you, for me is all right :)
File in directory (template direction)
default_template.php /html/com_virtuemart/productdetails
and
default_template.php /html/com_virtuemart/category
change
$oldPriceProps = array('name' => 'basePrice', 'description' => 'COM_VIRTUEMART_PRODUCT_BASEPRICE', $productItems->productPrice->prices, true);
for

$oldPriceProps = array('name' => 'basePriceWithTax', 'description' => 'COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX', $productItems->productPrice->prices, true);

Of course you need to disable base price and enable showing base price with tax in virtuemart

I find some solution, pleas check is this work for you, for me is all right :) File in directory (template direction) default_template.php /html/com_virtuemart/productdetails and default_template.php /html/com_virtuemart/category change $oldPriceProps = array('name' => 'basePrice', 'description' => 'COM_VIRTUEMART_PRODUCT_BASEPRICE', $productItems->productPrice->prices, true); for $oldPriceProps = array('name' => 'basePriceWithTax', 'description' => 'COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX', $productItems->productPrice->prices, true); Of course you need to disable base price and enable showing base price with tax in virtuemart

Last edited 06 June 2016 by artur.dulian

artur.dulian
19 Posts
artur.dulian posted this 06 June 2016

False, it's help only partial... this topis need solution

False, it's help only partial... this topis need solution
Chrisnz
39 Posts
Chrisnz posted this 07 June 2016

Any solution for this? It's quite important and functionality that is part of Virtuemart but Themler is preventing from working

Any solution for this? It's quite important and functionality that is part of Virtuemart but Themler is preventing from working
artur.dulian
19 Posts
artur.dulian posted this 07 June 2016

I fond yesterday something :) well problem is that when you have new price and old price (of course when you add this feature that I posted earler) you will see new price and old price, but when you don't ad new price then old and sold price is thisame and show two times :P so I change two files in template default_template.php in template virtuemart productdetail and category to check, if old price is thisame like new price, then old price is hidden, but when if difreent then show old and new price, so simle :) for me its working, I tested it.

$oldPriceProps = array('name' => 'basePriceWithTax', 'description' => 'COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX', $productItems->productPrice->prices, true);

CHANGE TO :

if (round($product->prices['basePriceWithTax'],$this->currency->_priceConfig['salesPrice'][1]) != round($product->prices['salesPrice'],$this->currency->_priceConfig['salesPrice'][1]))
{

                $oldPriceProps = array('name' => 'basePriceWithTax', 'description' => 'COM_VIRTUEMART_PRODUCT_BASEPRICE', $productItems->productPrice->prices, true);
            }else

{

                $oldPrice = false;
            } array('name' => 'basePriceWithTax', 'description' => 'COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX', $productItems->productPrice->prices, true);

I fond yesterday something :) well problem is that when you have new price and old price (of course when you add this feature that I posted earler) you will see new price and old price, but when you don't ad new price then old and sold price is thisame and show two times :P so I change two files in template default_template.php in template virtuemart productdetail and category to check, if old price is thisame like new price, then old price is hidden, but when if difreent then show old and new price, so simle :) for me its working, I tested it. $oldPriceProps = array('name' => 'basePriceWithTax', 'description' => 'COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX', $productItems->productPrice->prices, true); CHANGE TO : if (round($product->prices['basePriceWithTax'],$this->currency->_priceConfig['salesPrice'][1]) != round($product->prices['salesPrice'],$this->currency->_priceConfig['salesPrice'][1])) { $oldPriceProps = array('name' => 'basePriceWithTax', 'description' => 'COM_VIRTUEMART_PRODUCT_BASEPRICE', $productItems->productPrice->prices, true); }else { $oldPrice = false; } array('name' => 'basePriceWithTax', 'description' => 'COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX', $productItems->productPrice->prices, true);
Chrisnz
39 Posts
Chrisnz posted this 07 June 2016

Brilliant!
Thank you

Brilliant! Thank you

Last edited 07 June 2016 by Chrisnz

souacz
44 Posts
souacz posted this 26 June 2019

I would like to refresh the topic, in the current version of viruemart / themler this solution does not work because there are no such lines in the template files. How to set up the display of prices at the moment, so that when we have a discount, the price before the discount (with tax) and the price after the discount are displayed? Even if I mark the display of all prices in Virtuemart - the price before the discount is not displayed

I would like to refresh the topic, in the current version of viruemart / themler this solution does not work because there are no such lines in the template files. How to set up the display of prices at the moment, so that when we have a discount, the price before the discount (with tax) and the price after the discount are displayed? Even if I mark the display of all prices in Virtuemart - the price before the discount is not displayed

Last edited 26 June 2019 by souacz

souacz
44 Posts
souacz posted this 27 June 2019

I done it.

In template folder go to html/com_virtuemart/category/default_template.php and find

        $oldPrice = false;
    $oldPriceObj = array('description' => 'COM_VIRTUEMART_PRODUCT_BASEPRICE', 'html' => '');
    $regularPriceObj = array('description' => 'COM_VIRTUEMART_PRODUCT_SALESPRICE', 'html' => '');

    if (is_array($productItems->productPrice->prices)) {
        $oldPriceObj['html'] = call_user_func_array(array(&$productItems->productPrice->currency, 'createPriceDiv'),
            array(
                'name' => 'basePrice',
                'description' => 'COM_VIRTUEMART_PRODUCT_BASEPRICE',
                $productItems->productPrice->prices,
                true
            )
        );

and replace with

                   $oldPrice = false;
    $oldPriceObj = array('description' => 'COM_VIRTUEMART_PRODUCT_BASEPRICE', 'html' => '');
    $regularPriceObj = array('description' => 'COM_VIRTUEMART_PRODUCT_SALESPRICE', 'html' => '');

    if (is_array($productItems->productPrice->prices)) {
        if ($product->prices['basePriceWithTax'] != $product->prices['salesPrice'] )
       {
        $oldPriceObj['html'] = call_user_func_array(array(&$productItems->productPrice->currency, 'createPriceDiv'),
            array(
                'name' => 'basePriceWithTax',
                'description' => 'COM_VIRTUEMART_PRODUCT_BASEPRICE',
                $productItems->productPrice->prices,
                true
            )
        );
        }
     else {
        }

You need to find all such lines (in my template file there were 4x)

Then go to html/com_virtuemart/productdetails/default_template.php and also replace above lines.

Now, when a customer is in group that has a discount and is logged in - VM shows old prices (base price with tax before discount) and new prices. For public (not logged users) VM shows only baseprice with tax

I done it. In template folder go to html/com_virtuemart/category/default_template.php and find $oldPrice = false; $oldPriceObj = array('description' => 'COM_VIRTUEMART_PRODUCT_BASEPRICE', 'html' => ''); $regularPriceObj = array('description' => 'COM_VIRTUEMART_PRODUCT_SALESPRICE', 'html' => ''); if (is_array($productItems->productPrice->prices)) { $oldPriceObj['html'] = call_user_func_array(array(&$productItems->productPrice->currency, 'createPriceDiv'), array( 'name' => 'basePrice', 'description' => 'COM_VIRTUEMART_PRODUCT_BASEPRICE', $productItems->productPrice->prices, true ) ); and replace with $oldPrice = false; $oldPriceObj = array('description' => 'COM_VIRTUEMART_PRODUCT_BASEPRICE', 'html' => ''); $regularPriceObj = array('description' => 'COM_VIRTUEMART_PRODUCT_SALESPRICE', 'html' => ''); if (is_array($productItems->productPrice->prices)) { if ($product->prices['basePriceWithTax'] != $product->prices['salesPrice'] ) { $oldPriceObj['html'] = call_user_func_array(array(&$productItems->productPrice->currency, 'createPriceDiv'), array( 'name' => 'basePriceWithTax', 'description' => 'COM_VIRTUEMART_PRODUCT_BASEPRICE', $productItems->productPrice->prices, true ) ); } else { } You need to find all such lines (in my template file there were 4x) Then go to html/com_virtuemart/productdetails/default_template.php and also replace above lines. Now, when a customer is in group that has a discount and is logged in - VM shows old prices (base price with tax before discount) and new prices. For public (not logged users) VM shows only baseprice with tax

Last edited 27 June 2019 by souacz

You must log in or register to leave comments