News:

Looking for documentation? Take a look on our wiki

Main Menu

Cart content-based pricing

Started by dmb, April 27, 2016, 18:24:22 PM

Previous topic - Next topic

dmb

J3.5.1
VM3.0.16

Our site sells tickets for events that we run, where the pricing is based on shopper groups. We also sell membership products that allow people to change shopper group so that they can get member discount. This has the complication that if a shopper buys a membership product and an event product in the same transaction they are not a member when they fill their cart, so they don't get member discount.

I'd like to re-price the basket so that the price of the event in the cart reflects the cost to a member of the type of membership they're buying.

I'm anticipating that this is a coding job, and I'm happy to do this but I'd really appreciate some guidance as to the approach to take. Do I hack the core files ? Can I override some files ? Or should I look to develop a component to do this ? (I did look around to see if there was something that did this already, but I don't see anything)

All the best,

David

PRO

you would do a product plugin for the membership products,

cart attribute "hidden"

if in cart, change the users shopper group

dmb

Hi,

That sounds just like what I need I think, however I'd need it to be more like 'if in cart, update the prices for each other product in the cart to match the kind of shoppergroup matching this membership' - still possible ?

Also, 'if removed from the cart', revert to the prices for the visitor's current shoppergroup.

I'll go find out more about writing plugins :)

Thanks for the tip !

David

PRO


dmb

Hi,

I've created a plugin of sorts, of type vmcustom (which is probably wrong) that implements a class called plgVmCustomRepriceCart (which is probably wrong) that extends vmCustomPlugin (which is probably wrong too !). It installs fine, but never gets triggered when I add items to the cart.

I'm probably barking completely up the wrong tree here but I'm out of ideas, any hints to get me going again would be great :)

David

PRO

maybe there is a faster way.

look at this plugin.
http://extensions.virtuemart.net/promotions/bonus-detail

this might be workable depending on the configuration


dmb

Looks good, I'll check it out thanks !

David