VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: nikonor on February 26, 2012, 12:25:01 PM

Title: Dynamic prices update
Post by: nikonor on February 26, 2012, 12:25:01 PM
Dynamic prices update not worked for me. (VM 2.0.2 Joomla! 2.5.1)
I make this patch and it`s working!
administrator\components\com_virtuemart\helpers\calculationh.php
line around 324
after this
Code (php) Select
if (empty($prices['basePriceVariant'])) {
$prices['basePriceVariant'] = $prices['basePrice'];
}

paste this
Code (php) Select
$prices['basePrice']=$prices['basePrice']*$this->_amount;//nikonor

then go to components\com_virtuemart\controllers\productdetails.php
line around 248
after
Code (php) Select
foreach ( $prices as $name => $product_price  ){
$priceFormated[$name] = $currency->createPriceDiv($name,'',$prices,true);
}

comment next code
Code (php) Select
//$document = JFactory::getDocument();
//$document->setName('recalculate');
//JResponse::setHeader('Cache-Control','no-cache, must-revalidate');
//JResponse::setHeader('Expires','Mon, 6 Jul 2000 10:00:00 GMT');
//$document->setMimeEncoding( 'application/json' );
//JResponse::setHeader('Content-Disposition','attachment;filename="recalculate.json"', true);
//JResponse::sendHeaders();
Title: Re: Dynamic prices update
Post by: Jumbo! on February 26, 2012, 16:25:17 PM
I reconfirm this. Dynamic price update feature has stopped working in VM 2.0.2. This needs to be fixed in the upcoming version.
Title: Re: Dynamic prices update
Post by: Jumbo! on February 26, 2012, 16:40:16 PM
Quote from: nikonor on February 26, 2012, 12:25:01 PM
Dynamic prices update not worked for me. (VM 2.0.2 Joomla! 2.5.1)
I make this patch and it`s working!
administrator\components\com_virtuemart\helpers\calculationh.php
line around 324
after this
Code (php) Select
if (empty($prices['basePriceVariant'])) {
$prices['basePriceVariant'] = $prices['basePrice'];
}

paste this
Code (php) Select
$prices['basePrice']=$prices['basePrice']*$this->_amount;//nikonor

then go to components\com_virtuemart\controllers\productdetails.php
line around 248
after
Code (php) Select
foreach ( $prices as $name => $product_price  ){
$priceFormated[$name] = $currency->createPriceDiv($name,'',$prices,true);
}

comment next code
Code (php) Select
//$document = JFactory::getDocument();
//$document->setName('recalculate');
//JResponse::setHeader('Cache-Control','no-cache, must-revalidate');
//JResponse::setHeader('Expires','Mon, 6 Jul 2000 10:00:00 GMT');
//$document->setMimeEncoding( 'application/json' );
//JResponse::setHeader('Content-Disposition','attachment;filename="recalculate.json"', true);
//JResponse::sendHeaders();

This solution does not work for me.
Title: Re: Dynamic prices update
Post by: Milbo on February 26, 2012, 17:55:55 PM
This is just the session, logout and login again. The reason for this is the performance.
Title: Re: Dynamic prices update
Post by: TarGG58 on March 05, 2012, 12:45:12 PM
Man your'e the f...ing best  ;D

THANK YOU!
Title: Re: Dynamic prices update
Post by: MikeUK on April 04, 2012, 17:15:46 PM
Interesting......    Two things to add here.....

1) I don't think nikonor's fix is quote going about this the right way.

2) I don't think this is only a session issue, although @TarGG58, would be good if you could state what you did that worked for you. Did you just logout / login? Was it anything to do with nikonor's post? It might help others if you could clarify.

I looked into this briefly due to a client project, although the solution I wanted was not about 'fixing' this, so haven't followed up yet (due to time). Neither the client's site, nor my test site had dynamic price updating (version 2.02, Joomla 1.7) on quantity change. A variety of Jquery configs (google api on / off, vm jquery on/off) in VM backend didn't affect this.

What I'm going to do is test this with the latest release, different server, latest Joomla. It may simply be my / clients setup. If not sorted, I will see if client's work can be converted to a fix here for this (assuming I get their permission).
Title: Re: Dynamic prices update
Post by: TarGG58 on April 18, 2012, 14:21:37 PM
Sry for the late answer.

I just take the code from the first post, and so it works. There is no session fault or something like that
Title: Re: Dynamic prices update
Post by: Jumbo! on May 14, 2012, 08:10:21 AM
This problem is already resolved in VM 2.0.6