Forums / Built-in Shipping and Payment Modules / FreeShipping based on Group Pricing per Item

FreeShipping based on Group Pricing per Item

Locked

Views: 1,883

Results 1 to 20 of 20
This thread is locked. New replies are disabled.
9 Mar 2010, 6:12 AM
#1
rfree190 avatar

rfree190

Zen Follower

Join Date:
Sep 2007
Posts:
176
Plugin Contributions:
0

FreeShipping based on Group Pricing per Item

I'm running 1.3.8a.
I have installed Group Pricing per Item and have Three groups defined; Wholesale, Distributor and Distributor2.

I would like to set up shipping for Wholesale customers to be FREE over $150 and for Distributor and Distributor2 to be FREE over $1000.

If they don't qualify for FREE shipping, then they will pay normal UPS shipping rates based on weight.

How would I set up the FREE shipping based on the THREE groups I have set?

Thanks for any help,

Rick

9 Mar 2010, 2:52 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: FreeShipping based on Group Pricing per Item

If you want to offer ONLY Free Shipping based on the Group and amount, then you have more customization work to do than if you wanted to offer a Free shipping Option based on the Group and amount ...

Which way do you want this to be done?

1 Add a Free Shipping Option when a Group reaches their Free Shipping Amount ...

2 Only offer Free Shipping when a Group reaches their Free Shipping Amount ...

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!

9 Mar 2010, 6:39 PM
#3
rfree190 avatar

rfree190

Zen Follower

Join Date:
Sep 2007
Posts:
176
Plugin Contributions:
0

Re: FreeShipping based on Group Pricing per Item

Ajeh:

Which way do you want this to be done?

1 Add a Free Shipping Option when a Group reaches their Free Shipping Amount ...

2 Only offer Free Shipping when a Group reaches their Free Shipping Amount ...

The first options sounds better. This will give them the option of selecting a faster shipping method at a price.

9 Mar 2010, 9:51 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: FreeShipping based on Group Pricing per Item

Good ... that will save on a lot of extra custom coding and limit it to the shipping module ...

What shipping module(s) are you using right now?

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!

9 Mar 2010, 11:33 PM
#5
rfree190 avatar

rfree190

Zen Follower

Join Date:
Sep 2007
Posts:
176
Plugin Contributions:
0

Re: FreeShipping based on Group Pricing per Item

Ajeh:

What shipping module(s) are you using right now?

I am currently using:
FreeOptions
StorePickUp &
UPS

I don't need any different options for StorePickup, which is free for all groups and UPS which is based on weight only. I just need it for the FreeOptions.

Thanks for your help, Linda!

Rick

10 Mar 2010, 12:45 AM
#6
ajeh avatar

ajeh

Oba-san

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

Re: FreeShipping based on Group Pricing per Item

Are you currently using the Free Options freeoptions for anything specific other than trying to build something for Free shipping based on these Groups and Amounts?

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!

10 Mar 2010, 1:02 AM
#7
rfree190 avatar

rfree190

Zen Follower

Join Date:
Sep 2007
Posts:
176
Plugin Contributions:
0

Re: FreeShipping based on Group Pricing per Item

Ajeh:

Are you currently using the Free Options freeoptions for anything specific other than trying to build something for Free shipping based on these Groups and Amounts?

No, just this.

10 Mar 2010, 2:31 AM
#8
ajeh avatar

ajeh

Oba-san

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

Re: FreeShipping based on Group Pricing per Item

I would use the Flat Rate shipping module, clone it and customize it to have $.00 for the shipping charge based on Group and order amount ...

This way you would have a customized shipping module that doesn't get overwritten and shows as an alternative shipping method based on the Group and their Amount ...

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!

11 Mar 2010, 5:40 AM
#9
rfree190 avatar

rfree190

Zen Follower

Join Date:
Sep 2007
Posts:
176
Plugin Contributions:
0

Re: FreeShipping based on Group Pricing per Item

Ajeh:

I would use the Flat Rate shipping module, clone it and customize it to have $.00 for the shipping charge based on Group and order amount ...

OK, I found how to clone the Flat Rate shipping module, but how do I customize it to have $zero for the charge based on Group and Order Amount?

11 Mar 2010, 2:26 PM
#10
ajeh avatar

ajeh

Oba-san

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

Re: FreeShipping based on Group Pricing per Item

Next, you need to get which group the customer belongs to and what the amount is ...

Then, based on these results you need to enable the module when it should show ...

Something line this should work:

[B]     // disable only when entire cart is free shipping
      if (zen_get_shipping_enabled($this->code)) {
        $this->enabled = ((MODULE_SHIPPING_FLAT_STATUS == 'True') ? true : false);
      }
[/B]
// bof: test group and order amount
// do not test if in the admin
if (!IS_ADMIN_FLAG) {
  global $cart;
  $order_total_amount = $_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices() ;

  $group_query = $db->Execute("select customers_group_pricing from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$_SESSION['customer_id'] . "'");

  // display current results to screen for testing comment out to not show
  echo 'Customer in group: ' . $group_query->fields['customers_group_pricing'] . ' order amount: ' . $order_total_amount;

  // disable for everyone
  $this->enabled = false;
  // distributor customers_group_pricing 1
  if ($group_query->fields['customers_group_pricing'] == 1 && $order_total_amount > 1000) {
    $this->enabled  = true;
  }
  // distributor customers_group_pricing 2
  if ($group_query->fields['customers_group_pricing'] == 2 && $order_total_amount > 1000) {
    $this->enabled  = true;
  }
  // wholesaler customers_group_pricing 3
  if ($group_query->fields['customers_group_pricing'] == 3 && $order_total_amount > 150) {
    $this->enabled  = true;
  }
}
// eof: test group and order amount

      if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FLAT_ZONE > 0) ) {

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!

12 Apr 2010, 7:28 AM
#11
rfree190 avatar

rfree190

Zen Follower

Join Date:
Sep 2007
Posts:
176
Plugin Contributions:
0

Re: FreeShipping based on Group Pricing per Item

Hi Linda,
I'm back... Took a little family time off:hug:

I have cloned the Flat Rate shipping module, flatone.php and flattwo.php. Along with each Language file, also flatone.php and flattwo.php.

Where do I add the code you provided? To the beginning of each of the Flat Rate module files?

Thanks!!! :clap:

12 Apr 2010, 12:57 PM
#12
ajeh avatar

ajeh

Oba-san

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

Re: FreeShipping based on Group Pricing per Item

Look in the above code ... I marked in bold the existing code ... below it is the new code ...

You should see in your shipping code a similar block of code ...

Add the new code beneath it ... then, adapt the code as needed ...

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!

12 Apr 2010, 6:22 PM
#13
rfree190 avatar

rfree190

Zen Follower

Join Date:
Sep 2007
Posts:
176
Plugin Contributions:
0

Re: FreeShipping based on Group Pricing per Item

Thanks!

Just one follow up question...
Do I need to clone the Flat Rate Shipping Module for each of the groups? Or, just once?

Then, using the code you sent, modify it to match each group, ie, Group 1 when over $150, Group 2 when over $1500....

12 Apr 2010, 6:35 PM
#14
ajeh avatar

ajeh

Oba-san

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

Re: FreeShipping based on Group Pricing per Item

If flat rate shipping charge is the same for the 3 groups then you can use the 1 copy with the tests in it ...

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!

12 Apr 2010, 6:39 PM
#15
rfree190 avatar

rfree190

Zen Follower

Join Date:
Sep 2007
Posts:
176
Plugin Contributions:
0

Re: FreeShipping based on Group Pricing per Item

Yes, they are all free shipping once they reach their perspective dollar amounts.

I have modified the code you sent to match the Group ID as well as each of their Free Shipping dollar amounts. Next is a little testing...

Thanks again for all your help, on this issue and the others you have helped me on!

Rick

12 Apr 2010, 10:16 PM
#16
rfree190 avatar

rfree190

Zen Follower

Join Date:
Sep 2007
Posts:
176
Plugin Contributions:
0

Re: FreeShipping based on Group Pricing per Item

One last question if you don't mind...:blush:

Can I also add a few lines to create FREE SHIPPING for customers that are not included in one of my GROUPS?
Something like this:

// Retail customers_group_pricing NULL
      if ($group_query->fields['customers_group_pricing'] == '' && $order_total_amount > 40) {
        $this->enabled  = true;
      }

Or would this be asking for trouble?

Thanks!!!

13 Apr 2010, 12:52 AM
#17
ajeh avatar

ajeh

Oba-san

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

Re: FreeShipping based on Group Pricing per Item

You can add as many customizations as you like ... just be sure to test them all to ensure that they are working the way you expect them to ... :smile:

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!

13 Apr 2010, 1:02 AM
#18
ajeh avatar

ajeh

Oba-san

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

Re: FreeShipping based on Group Pricing per Item

Be aware that also includes anyone not yet logged in ... so you might want to decide if that is a good idea or if you need to check if the person is also logged in ...

Otherwise ... I come to your site as part of group 3 and see that shipping is free then login and shipping is no longer free ...

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!

13 Apr 2010, 1:25 AM
#19
rfree190 avatar

rfree190

Zen Follower

Join Date:
Sep 2007
Posts:
176
Plugin Contributions:
0

Re: FreeShipping based on Group Pricing per Item

Yes, we have basically 4 groups;
Retail (or not logged in)
Salons (about 50% off retail)
Distributors (About 50% off Salons)
and Family/Friends (Salon Price)

As long as our Salons and Distributors know they are getting a better price than the group above them, everyone should be ok with the shipping prices. Hopefully!

Thanks again for all your help.
As soon as I finish this cart project, I'm sending the team a "cup of coffee"! Thanks to EVERYONE at Zen-Cart!
:clap::clap::clap::clap::clap::clap::clap:

13 Apr 2010, 3:07 AM
#20
ajeh avatar

ajeh

Oba-san

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

Re: FreeShipping based on Group Pricing per Item

You are most welcome ... good luck with your shop ... :smile:

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!