VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: SteP[IT] on January 24, 2015, 21:08:25 PM

Title: createPriceDiv fails in /cart/default_pricelist.php: issue or my fault?
Post by: SteP[IT] on January 24, 2015, 21:08:25 PM
I'm in the needing of showing the "basePriceVariant" in my cart: then I have commented out the "if" in lines 51 and 53 of default_pricelist.php to show the hidden content I want, as hereafter:

if (VmConfig::get ('checkout_show_origprice', 1) && $prow->prices['discountedPriceWithoutTax'] != $prow->prices['priceWithoutTax']) {
echo '<span class="line-through">' . $this->currencyDisplay->createPriceDiv ('basePriceVariant', '', $prow->prices, TRUE, FALSE) . '</span><br />';
}


But also commenting out those line the <span> content is empty...
I have been able to get the correct value only modifing the line 52 as hereafter:

echo '<span class="line-through">' . $this->currencyDisplay->createPriceDiv ('', '', $prow->prices['basePriceVariant'], TRUE, FALSE) . '</span><br />';


In this way I get the correct crossed base price: I had to put an empty value in the first "createPriceDiv" argument, and put the corresponding full array value reference in the third argument.

The same happens for the lines 56 and 58 of the same file: only empting the first "createPriceDiv" argument, and putting the vhole array reference value in the third I get the desired value.

Is this a bug or a wanted result?

Any hint will be appreciated.

Regards
Title: Re: createPriceDiv fails in /cart/default_pricelist.php: issue or my fault?
Post by: GJC Web Design on January 24, 2015, 22:25:28 PM
check the actual function in administrator\components\com_virtuemart\helpers\currencydisplay.php line 314
to see how it works

public function createPriceDiv($name,$description,$product_price,$priceOnly=false,$switchSequel=false,$quantity = 1.0,$forceNoLabel=false)
Title: Re: createPriceDiv fails in /cart/default_pricelist.php: issue or my fault?
Post by: SteP[IT] on January 25, 2015, 22:31:38 PM
Done, thanks :)