Zen Cart Logo

Group Shipping

Locked

Views: 2,143

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
13 Dec 2006, 5:42 AM
#1
datacreek avatar

datacreek

New Zenner

Join Date:
Dec 2006
Posts:
15
Plugin Contributions:
0

Group Shipping

I am configing a store for a client who will be selling retail and wholesale.
He wants to offer free shipping to retail customers but charge shipping for wholesale.

Perhaps how to do this has been answered somewhere but I've searched plugins, the forum and tutorials/faqs and although I found a post written in May 2006 there were no replies that resolved this.

I would think this is not that unusual a scenario so I'm hoping somebody can help.

Thanks

13 Dec 2006, 6:18 AM
#2
datacreek avatar

datacreek

New Zenner

Join Date:
Dec 2006
Posts:
15
Plugin Contributions:
0

Re: Group Shipping

Is the solution to create a coupon for free shipping and just give that to all wholesale buyers.

Any other methods I might not know about would be welcome.

Thanks,

13 Dec 2006, 6:20 AM
#3
ajeh avatar

ajeh

Oba-san

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

Re: Group Shipping

He wants to offer free shipping to retail customers but charge shipping for wholesale.

Why would you give the Free Shipping coupon to the wholesalers?

14 Dec 2006, 1:45 AM
#4
datacreek avatar

datacreek

New Zenner

Join Date:
Dec 2006
Posts:
15
Plugin Contributions:
0

Re: Group Shipping

Right, that was stupid ... it was late at night and I had had little sleep the night before.

In order for this to be a solution I will have to display a coupon code for all retailers. C'mon there's got to be a better way.

Surely there is a way to offer free shipping for default and paid shipping for a group.

I would certainly appreciate any ideas.

Thanks,

14 Dec 2006, 1:56 AM
#5
ajeh avatar

ajeh

Oba-san

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

Re: Group Shipping

Anything is possible ... you just have to code for it ... :eek:

There has to be a flag of some sort to distinguish a customer from a wholesaler ...

Then that has to be adapted into your shipping modules to know when to run each one ...

Now you just have to put on your coder hat ... :smartass:

14 Dec 2006, 2:02 AM
#6
datacreek avatar

datacreek

New Zenner

Join Date:
Dec 2006
Posts:
15
Plugin Contributions:
0

Re: Group Shipping

Well, yeah...

Perhaps someone could reply with a little more direction or a solution they have come up with. I'm pretty good at hacking at code but not necessarily writing from scratch.

Surely someone has encountered and solved this.

Thanks

14 Dec 2006, 2:10 AM
#7
ajeh avatar

ajeh

Oba-san

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

Re: Group Shipping

You write a function to return true or false based on if the customer is a wholesaler or not ...

Then use that function to control the $this->enabled in each of the shipping modules you are using plus the Free Shipping Options shipping module where you define that one to show when Total is >=0 ...

Note: you have to write a matching function for the Admin so that the Modules ... Shipping can run ...

You might peek at the current function in the shipping modules, such as:
/includes/modules/shipping/item.php

      // disable only when entire cart is free shipping
      if (zen_get_shipping_enabled($this->code)) {
        $this->enabled = ((MODULE_SHIPPING_ITEM_STATUS == 'True') ? true : false);
      }

If you look at the function in the Catalog and the Admin you will see how the Admin function zen_get_shipping_enabled simply returns a true ...

The Catalog function zen_get_shipping_enabled manages what to do to show/hide the shipping modules based on Free Shipping as managed based on Always Free Shipping and 0 weight being Free Shipping etc.

NOTE: do not confuse the existing function zen_get_shipping_enabled as being something you should touch to manage your Free Shipping ...

Your needs are not the same purpose as the existing function ... so you want to write your own based on your conditions ...

14 Dec 2006, 2:36 AM
#8
datacreek avatar

datacreek

New Zenner

Join Date:
Dec 2006
Posts:
15
Plugin Contributions:
0

Re: Group Shipping

Thank you so much... that will get me going!

Jody

14 Dec 2006, 2:58 AM
#9
ajeh avatar

ajeh

Oba-san

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

Re: Group Shipping

Keep in mind ... all you need is the $this->enabled to either not be called or set to false and the shipping module, even if installed, will not display ...

So a simple statement such as:

if (my_function($this->code)) {
      // disable only when entire cart is free shipping
      if (zen_get_shipping_enabled($this->code)) {
        $this->enabled = ((MODULE_SHIPPING_ITEM_STATUS == 'True') ? true : false);
      }
}

Can control this where the function my_function gets the paramater of which shipping module is calling it and that can just have a bunch of IFs or CASE statements in it to determin true or false ...

Then the Admin version of my_function only needs to return true ...

Might peek at the:
/includes/functions/extra_functions

directory, there is one for the /admin too ...

Toss a php file name anything you like ... might use my_shipping.php and it will run as if part of general.php ...

easy smeazy, eh? :cool: