VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Coding Central => Topic started by: dragonself on April 22, 2014, 05:09:42 AM

Title: Suggest to passing $this to plgVmOnAddToCart
Post by: dragonself on April 22, 2014, 05:09:42 AM
VM 2.6.0
helpers/cart.php Line 588
From
$addToCartReturnValues = $dispatcher->trigger('plgVmOnAddToCart',array(&$product));
to
$addToCartReturnValues = $dispatcher->trigger('plgVmOnAddToCart',array(&$product, $this));

The reason to suggest this is because without the change, custom field plugin cannot combine the same product(with the same custom field option) in the cart

Example, I have a custom field plugin option for product color ( green, red, blue). If I select green and click "Add to cart" twice, it appear as two row of green X 1 in the cart. Which 1 row of green X 2 is more make sense.

Thanks
Philip

Title: Re: Suggest to passing $this to plgVmOnAddToCart
Post by: lindapowers on April 27, 2014, 03:38:37 AM
Yeah that makes sense.
Title: Re: Suggest to passing $this to plgVmOnAddToCart
Post by: Milbo on April 27, 2014, 19:58:23 PM
Useless to talk about vm2.6 for that. This would change the API and is therefore for vm3 and I give the idea to take a look there
Title: Re: Suggest to passing $this to plgVmOnAddToCart
Post by: Milbo on April 28, 2014, 14:58:14 PM
and yeh please check all triggers of vm3, we are open for suggestions there.