News:

Looking for documentation? Take a look on our wiki

Main Menu

Add to cart hook without using customfield plugins

Started by zanardi, November 26, 2012, 12:39:15 PM

Previous topic - Next topic

zanardi

Hello, I am using VM 2.0.14.

I am trying to write a plugin and would like a suggestion on which hook I should use.

I need to set an action on "add to cart". I tried with a "VMCustom" plugin, but it seems to me that this is mainly related to custom fields for specific products. I don't want to add a custom field to all my products to be able to trigger my action.
Is there any better hook that I am missing?

Thank you for your time.
--
Francesco (zanardi)
http://extensions.gibilogic.com
@gibilogic on Twitter

sandomatyas

Great question.
Is there a plugin method which is triggered when I add a product to the cart (or somwhere around getCart() function)?

Studio 42

You can use a payment or shipment plugin. This get triggered too.
So it depend your need, but you can use 'plgVmOnAddToCartFilter' in VM 3 if a customfield exist or a Joomla plugin too for a more general way to check add to cart.

dmb

J3.5.1
VM3.0.16

Hi,

Where's a good place to go to find out more about how to do this ? I need to reprice my cart when a particular product is added to it or taken out (buying membership product gives you discount on all the other ones). I'm piecing the puzzle together but it's hard to know where to start.

Any tips gratefully received !

David

Studio 42

Quote from: dmb on April 28, 2016, 10:40:12 AM
J3.5.1
VM3.0.16

Hi,

Where's a good place to go to find out more about how to do this ? I need to reprice my cart when a particular product is added to it or taken out (buying membership product gives you discount on all the other ones). I'm piecing the puzzle together but it's hard to know where to start.

Any tips gratefully received !

David
Awo coupon PRO can do many of this hooks.