Author Topic: 2.0.18 wrong multiple price for children products  (Read 13236 times)

atrus

  • Jr. Member
  • **
  • Posts: 128
    • Quality Tuning
  • VirtueMart Version: 3.8.6
Re: 2.0.18 wrong multiple price for children products
« Reply #15 on: April 03, 2013, 16:08:19 pm »
Correct; i really hope the devs will take a look at this bug at some point, it's there for some time now.

Rgrds

Joseph Kwan

  • Advanced
  • Full Member
  • *****
  • Posts: 2344
Re: 2.0.18 wrong multiple price for children products
« Reply #16 on: April 04, 2013, 08:12:05 am »
In case the child product price is the same as parent product price,  comment out lines 625-627 in the file /plugins/vmcustom/stockable/stockable.php will probably help.

Not sure this will work but you can give it a try and report back.
Joomla/VM Upgrade Services. Problems with your migration? We can help.
Custom extensions to VM. Performance Tuning. Template modifications and advices.
Pay service to make VM work according to your needs. Your Joomla/VM solutions are just a PM away.

atrus

  • Jr. Member
  • **
  • Posts: 128
    • Quality Tuning
  • VirtueMart Version: 3.8.6
Re: 2.0.18 wrong multiple price for children products
« Reply #17 on: April 05, 2013, 16:53:59 pm »
Hi Joseph,

Removed the following as per your suggestion:

{

            $db = JFactory::getDBO();

            $db->setQuery('SELECT `product_price` FROM `#__virtuemart_product_prices`  WHERE `virtuemart_product_id`="' . (int)$selected . '" ');

            if ($price = $db->loadResult()) $product->product_price = (float)$price;

         }

and it seems to WORK!

So it this a VM bug?

We are now checking / testing all other functionalities to see if anything is broken,thanks again!

Joseph Kwan

  • Advanced
  • Full Member
  • *****
  • Posts: 2344
Re: 2.0.18 wrong multiple price for children products
« Reply #18 on: April 05, 2013, 18:03:38 pm »
Good news. As I said, the stockable price calculation does not take into account the shopper group and other issue. This is a bug that needs to be fixed.

By commenting out the 3 lines, we are bypassing the stockable recalculation. That makes VM resort to the parent price. This works only if the parent and child price are the same. I don't foresee there are problems other than that.

Joomla/VM Upgrade Services. Problems with your migration? We can help.
Custom extensions to VM. Performance Tuning. Template modifications and advices.
Pay service to make VM work according to your needs. Your Joomla/VM solutions are just a PM away.

atrus

  • Jr. Member
  • **
  • Posts: 128
    • Quality Tuning
  • VirtueMart Version: 3.8.6
Re: 2.0.18 wrong multiple price for children products
« Reply #19 on: April 06, 2013, 01:42:28 am »
Quote
This works only if the parent and child price are the same.

Correct, this solution ofcourse doesn't work when the child product price is different than the parent product.

I'm trying to fix this by changing line 626 to smth like:

Code: [Select]
$db->setQuery('SELECT `product_price` FROM `#__virtuemart_product_prices`  WHERE `virtuemart_product_id`="' . (int)$selected . '" AND `virtuemart_shoppergroup_id`="' . (int)$_shopperGroupId . '" ');
But it's not working, i guess there is more than. Would appreciate a fix by the devs

Rgrds

atrus

  • Jr. Member
  • **
  • Posts: 128
    • Quality Tuning
  • VirtueMart Version: 3.8.6
Re: 2.0.18 wrong multiple price for children products
« Reply #20 on: April 23, 2013, 11:43:04 am »
Hi to all,

Any fix included in the latest svn?

Rgrds


Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10530
  • VM4.0.7 Eagle Owl
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: 2.0.18 wrong multiple price for children products
« Reply #21 on: July 10, 2013, 10:19:16 am »
The problem is that the stockable plugin is not using the standard vm method to load a product. So the normal stuff of deriving values from the parent do not work as expected.

We have two different methods to display stockable variants. One method is by openglobal, great js stuff and nice to handle. But it is old vm1 style, also the reason vm1 veterans prefer this method.

The other method "dynamical child variants" is using the vm methods to load a product. All parent/child stuff is there working as expected.

The future is a bit different. I want to add for vm2.1 a stock for every customfield, so we dont need anylonger this complex constructions, just for the stock.

The real fun with this stuff is atm anyway most time not used. For example to change the product image or dimensions.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

travelbaba

  • Beginner
  • *
  • Posts: 26
Re: 2.0.18 wrong multiple price for children products
« Reply #22 on: July 24, 2013, 23:25:17 pm »
Hello,

same problem for me. It looks like its' a bug of virtuemart.

DID YOU FIND THE SOLUTION?

I have many shopper groups, with different prices.
Let's say for group A the premier bag (all different color variant) costs 9 EUr
For group B 10 EUr
for group C 11

If I log with account A and I check all the variants it appears sometime 9, sometime 10, 11 with no reason.

Please check here: www.timeoutsport.com
login:
test test
and go to
http://www.timeoutsport.com/premier.html

thanks
Matteo

atrus

  • Jr. Member
  • **
  • Posts: 128
    • Quality Tuning
  • VirtueMart Version: 3.8.6
Re: 2.0.18 wrong multiple price for children products
« Reply #23 on: July 25, 2013, 08:23:46 am »
Hello Mateo,

Pls find a fix here:

http://forum.virtuemart.net/index.php?topic=117080.0

Just note that above fix works only if the user is assigned to 1 group, not multiple shopper groups.

Rgrds,
Chris

travelbaba

  • Beginner
  • *
  • Posts: 26
Re: 2.0.18 wrong multiple price for children products
« Reply #24 on: July 25, 2013, 09:02:28 am »
Hello,

it works!!!!

If you could reach you I will kiss your feet!!!!!

I had a sleepless night, and this morning You made me a wonderful gift!!!!!

THanks

Matteo