News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

plgVmOnAddToCart with a cart instead of a product??

Started by sgareste, April 19, 2018, 17:19:43 PM

Previous topic - Next topic

sgareste

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

Studio 42

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.