Forums / General Questions / Auto-add shopper to group pricing when they order specific product?

Auto-add shopper to group pricing when they order specific product?

Views: 641

Results 1 to 5 of 5
19 Jan 2012, 9:04 PM
#1
hockey2112 avatar

hockey2112

Zen Follower

Join Date:
Jun 2010
Posts:
204
Plugin Contributions:
0

Auto-add shopper to group pricing when they order specific product?

Hello,

Is there a way to add a customer to a pricing group when they order a specific product? for instance, I would like to sell a VIP account upgrade. Ideally, when the shopper purchases this product, they would be auto-added to the VIP Group Pricing group.

i would also still add occasional customers to the group via the admin backend, but the only other way they could be added to the group is if they order that VIP upgrade product.

Thanks!

20 Jan 2012, 6:34 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Auto-add shopper to group pricing when they order specific product?

Sure. You could write an observer class that triggers on one of the notifier hooks in the orders class where it's looping through all the cart contents as it's moving them into the new order that's just been paid-for, and have the observer check for a match on the product in question and make it update the purchaser's group membership at that time.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

9 Feb 2012, 10:29 PM
#3
hockey2112 avatar

hockey2112

Zen Follower

Join Date:
Jun 2010
Posts:
204
Plugin Contributions:
0

Re: Auto-add shopper to group pricing when they order specific product?

Very interesting. Would you happen to have an example of such a code snippet?

10 Feb 2012, 3:30 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Auto-add shopper to group pricing when they order specific product?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

13 Feb 2012, 1:38 AM
#5
hockey2112 avatar

hockey2112

Zen Follower

Join Date:
Jun 2010
Posts:
204
Plugin Contributions:
0

Re: Auto-add shopper to group pricing when they order specific product?

DrByte:

http://www.zen-cart.com/forum/showthread.php?t=187079
http://www.zen-cart.com/forum/showthread.php?t=155959
http://www.zen-cart.com/forum/showthread.php?t=189774
http://www.zen-cart.com/forum/showthread.php?t=69499

Ooooh, man... I could get myself into a lot of trouble with that info, espeically the API info on observer classes. This should be fun! :smile:

Thanks! :clap: