VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: sgareste on April 19, 2018, 17:19:43 PM

Title: plgVmOnAddToCart with a cart instead of a product??
Post by: sgareste on April 19, 2018, 17:19:43 PM
Hi,

In components/com_virtuemart/helpers/cart.php, in the add($virtuemart_product_ids=null,&$errorMsg='') function, around the bottom there is a
$dispatcher->trigger('plgVmOnAddToCart',array(&$this));

Every function plgVmOnAddToCart function that I can find in plugins and others are expecting a $product, and this is sending a VirtuemartCart. Is this a wanted behavior? How can we figure out which virtuemart_product_id was just added, given that the cart doesn't show the difference between what was there and what is new?

Simon
Title: Re: plgVmOnAddToCart with a cart instead of a product??
Post by: Studio 42 on April 20, 2018, 04:20:38 AM
plgVmOnAddToCart, is to check all cart  not only product,
Using $this, you can get any information from cart.
using $product, you only can have product information.