VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: depika on October 24, 2016, 15:41:50 PM

Title: Show twice the price at the product details page
Post by: depika on October 24, 2016, 15:41:50 PM
I have many custom fields at the product details page and as a result the price which is on top is not displaying next to the quantity and add to cart button.

I have the code
echo shopFunctionsF::renderVmSubLayout('prices',array('product'=>$this->product,'currency'=>$this->currency));

on top of the product details template and then I added this code at the sublayout addtocart.php
echo shopFunctionsF::renderVmSubLayout('prices1',array('product'=>$product,'currency'=>$currency));

but I am getting this error
Fatal error: Call to a member function createPriceDiv() on null in prices.php on line 36

I created a new prices1.php and I tried changing the div from salesPrice to salesPrice1 because I thought this was the problem but still the same problem.

I would appreciate your help.
Title: Re: Show twice the price at the product details page
Post by: depika on October 25, 2016, 08:36:02 AM
Line 36 is the following

echo $currency->createPriceDiv ('basePrice', 'COM_VIRTUEMART_PRODUCT_BASEPRICE', $product->prices);
Title: Re: Show twice the price at the product details page
Post by: Ghost on October 25, 2016, 09:46:31 AM
echo shopFunctionsF::renderVmSubLayout('prices1',array('product'=>$product,'currency'=>CurrencyDisplay::getInstance()));
Title: Re: Show twice the price at the product details page
Post by: depika on October 25, 2016, 12:30:51 PM
Quote from: Ghost on October 25, 2016, 09:46:31 AM
echo shopFunctionsF::renderVmSubLayout('prices1',array('product'=>$product,'currency'=>CurrencyDisplay::getInstance()));

Thank you!! It worked