Forums / Discounts/Coupons, Gift Certificates, Newsletters, Ads / Move customers automatically to defined pricing group after first purchase

Move customers automatically to defined pricing group after first purchase

Views: 1,947

Results 1 to 6 of 6
6 Jan 2013, 12:06 AM
#1
mybaby avatar

mybaby

New Zenner

Join Date:
Oct 2009
Posts:
14
Plugin Contributions:
0

Move customers automatically to defined pricing group after first purchase

Hi, firstly i'd like to thank all the contributors for their efforts over the years. I cannot tell you how many times i have used this forum to find the answers i was looking for. Thank you.

But, I have been searching for sometime now and unable to find a solution to something i need. I can see how you can add 'New Users' to 'Group Pricing' automatically, but i want to add them after they make their first purchase. Instead of installing a Reward Points module to give Returning customers a discount, i'd rather use this.

Perhaps an SQL update on the Email Order Confirmation. Or when you update an order from 'Pending' to 'Shipped'?

Any assistance would be greatly appreciated. p.s my php is lousy!

Thank you

13 Jan 2013, 4:03 AM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Move customers automatically to defined pricing group after first purchase

Do you want this to happen when the Order is placed?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

4 Mar 2013, 3:25 AM
#3
mybaby avatar

mybaby

New Zenner

Join Date:
Oct 2009
Posts:
14
Plugin Contributions:
0

Re: Move customers automatically to defined pricing group after first purchase

Yes, after the order is placed an SQL statement will UPDATE the group_pricing to '2' or whatever number you wish.

Thank you

4 Mar 2013, 3:39 AM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Move customers automatically to defined pricing group after first purchase

NOTE: If there is any reason that you do not ALWAYS what to update the Customer to Group ID (customers_group_pricing) 2, you will need to add additional limits ...

Edit the file:
/includes/classes/order.php

and around line 645 add the code in RED where 2 is the customers_group_pricing you want to change the customer to be in:

    zen_db_perform(TABLE_ORDERS, $sql_data_array);

[B]// bof: set customer group to 2
   $update_customers_group_sql = "update " . TABLE_CUSTOMERS . " SET customers_group_pricing = '2' WHERE customers_id = '" . $_SESSION['customer_id'] . "'";
   $db->Execute($update_customers_group_sql);
// eof: set customer group to 2
[/B]
    $insert_id = $db->Insert_ID();

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

23 Oct 2014, 6:07 PM
#5
crystal11 avatar

crystal11

New Zenner

Join Date:
Sep 2014
Location:
california
Posts:
6
Plugin Contributions:
0

Re: Move customers automatically to defined pricing group after first purchase

Yes, upon login. Also, I'd like to be able to offer it as a special and discontinue. thank you.

24 Oct 2014, 2:07 PM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Move customers automatically to defined pricing group after first purchase

So you want all current customers to be in this group and new customers to automatically be added to this group and then be able to set the group discount amount and whether or not is is available at any time correct?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!