Zen Cart Logo
Forums / Built-in Shipping and Payment Modules / Shipping - restrict carriers/options per Catagory

Shipping - restrict carriers/options per Catagory

Views: 1,567

Results 1 to 9 of 9
20 Jan 2015, 7:49 PM
#1
liderbug avatar

liderbug

Zen Follower

Join Date:
Jul 2009
Posts:
104
Plugin Contributions:
0

Shipping - restrict carriers/options per Catagory

v1.5.4

All the like posts are old and don't cover what I want/need to do.
Three Catagories:


Cat 1: Books, manuals ship USPS 1st/3d class best/cheapest.
Cat 2: Seeds must ship via UPS/FedEx 2 day - USPS likes to irradiate, kills the seeds
Cat 3: Live benificials: bees, ladybugs - UPS/FedEx overnight.

Short of hacking-da-L out of the shipping modules - which I can do (just don't want to re-invent the wheel). Has anyone written a Shipping Module - Per Catagory? Would need to include shipping type in the Product page.

Thanks

20 Jan 2015, 10:34 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Shipping - restrict carriers/options per Catagory

Are you using 3 Categories are are these 3 Categories with subcategories in them?

Aside from what Product is in which Category, can you control the shipping methods that are available per shipping method with the individual shipping modules?

What should happen if some orders from all 3 Categories? Which shipping method should be used then?

Have you an URL to your site that we could perhaps peek at as sometimes seeing makes it easier to understand how things are really setup on your site ...

21 Jan 2015, 4:43 AM
#3
liderbug avatar

liderbug

Zen Follower

Join Date:
Jul 2009
Posts:
104
Plugin Contributions:
0

Re: Shipping - restrict carriers/options per Catagory

A: Thanks for the reply.

Cat 1 Books, Prod 1 How to abc, Prod 2 When to xyz, Prod 3 150 page book ....

Cat 2 Seeds, Prod 1 Tomato, Prod 2 Pepper, Prod 3...

Cat 3 Benificals, Prod 1 Bees, Prod 2 Nematodes, Prod 3 ladybugs, ...

Mainly it has to do with shipping costs. The person in the warehouse handles what container which product goes in to - A HowTo Doc: USPS envelop. Tomato seeds: UPS envelop/box. Bees/Ladybugs: Insulated box -> UPS [ IE: they are kept cold until released ] So ya, someone could order from all 3 catagories (with 6 you get eggroll (sorry)) Lets say a ?normal? ZC site you order 4 things, weight comes to 2 lbs, you ship "everything" USPS, then shipping is $X.. But, shipping, I've got 2 sheets of 8x11 in a business envelop $.50(stamp), 8 oz of seed UPS $12.50 and 1000 Ladybugs in an insulated container ($7 surcharge for box), overnight, ??? FedEx $27.50. Product: HowTo free, seeds $123.00, Ladybugs $15. Total: $185.50 (numbers only for demo). "Products" would need a new "Catagory Shipping" column 1,2,3,(456).

21 Jan 2015, 2:41 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Shipping - restrict carriers/options per Catagory

What I am trying to get at is if someone orders

Product: HowTo free, seeds $123.00, Ladybugs $15. Total: $185.50 (numbers only for demo)

What should their choice of shipping be for this mixed cart of Products when you originally said you want to use:

Cat 1: Books, manuals ship USPS 1st/3d class best/cheapest.
Cat 2: Seeds must ship via UPS/FedEx 2 day - USPS likes to irradiate, kills the seeds
Cat 3: Live benificials: bees, ladybugs - UPS/FedEx overnight.

From what you are saying the How to free should be USPS, the LadyBugs should be UPS/FedEx and the seeds should be UPS/FedEx ... but in this order, all are in the same order so what shipping method should be offered in that case?

If Seeds are in the order then block USPS and offer UPS and FedEx?

If Books are the only thing in the order then block UPS and FedEx and offer USPS only?

21 Jan 2015, 8:39 PM
#5
liderbug avatar

liderbug

Zen Follower

Join Date:
Jul 2009
Posts:
104
Plugin Contributions:
0

Re: Shipping - restrict carriers/options per Catagory

What should their choice of shipping be for this mixed cart of Products when you originally said you want to use:
Cat 1: Books, manuals ship USPS 1st/3d class best/cheapest.
Cat 2: Seeds must ship via UPS/FedEx 2 day - USPS likes to irradiate, kills the seeds
Cat 3: Live benificials: bees, ladybugs - UPS/FedEx overnight.
From what you are saying the How to free should be USPS, the LadyBugs should be UPS/FedEx and the seeds should be UPS/FedEx ... but in this order, all are in the same order so what shipping method should be offered in that case?

Shipping method is not an option - IE: I want my bees shipped USPS. --- No! Not an option. Don't care if you like UPS or not. You want bees? Then the big brown truck will be in your driveway not a blue & white one. Per the title (and thanks for correcting it) shipping [and the fees charged ] depends on which category(s) ordered - Manuals ship at a different rate than Seeds. Right now, at checkout, shipping costs are calculated per method selected: A or B or C ... or by management (we ship everything Flat Rate). See my PM to you.

21 Jan 2015, 10:17 PM
#6
ajeh avatar

ajeh

Oba-san

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

Re: Shipping - restrict carriers/options per Catagory

Maybe I am not saying this clearly for you ...

If I order all 3, Bees, Document and Seeds in the same Order, what shipping method should be offered?

Or, are you trying to force the customer to order things separately to get the proper shipping offered?

22 Jan 2015, 5:39 PM
#7
liderbug avatar

liderbug

Zen Follower

Join Date:
Jul 2009
Posts:
104
Plugin Contributions:
0

Re: Shipping - restrict carriers/options per Catagory

If I order all 3, Bees, Document and Seeds in the same Order, what shipping method should be offered?
Or, are you trying to force the customer to order things separately to get the proper shipping offered?

"...what shipping ... be offered?" None. Method is not an option. Docs get shipped one way, Seeds another and Benificials a third way. Cat-1 goes USPS, Cat-2 goes UPS ground and Cat-3 goes Overnight. So the shipping cost on Cat-1 is $.50 to $20 depending on a business envelop or a USPS Flat Rate - no-rush. Cat-2 UPS/FedEx/dropship/fright... no-rush. Cat-3 must be kept cool and shipping time aprox 12 hr or less. So it's the calculation of shipping by category not what method.

The person packing up the order knows what to do. The code:
switch (category)
{
case 1: use_Per_Unit; Cheapest way, don't care when it shows up (within reason)
case 2: use_Per_Item; Non-USPS, cheapest, again don't care how fast
case 3: use_Flat_Rate; Non-USPS, overnight, cost is bite the bullet.
}
Oh and "Will Call" rears it head...

  • cat-2, seeds, fert, greenhouse kits (6x8 to 600x800), fans, bulky items.

Thanks

22 Jan 2015, 6:49 PM
#8
ajeh avatar

ajeh

Oba-san

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

Re: Shipping - restrict carriers/options per Catagory

And example of code for USPS to only allow Products in categories_id 1 where master_categories_id is 1, you can customize the code:
/includes/modules/shipping/usps.php

  function update_status() {
    global $order, $db;
    if (IS_ADMIN_FLAG == TRUE) return;

[B]// bof: only allow for master_categories_id 1
if (!IS_ADMIN_FLAG) {
  $chk_categories = 0;
  $chk_categories += $_SESSION['cart']->in_cart_check('master_categories_id','1');
  if ($_SESSION['cart']->count_contents() != $chk_categories) {
    $this->enabled = false;
  }
}
// eof: only allow for master_categories_id 1
[/B]
    // disable only when entire cart is free shipping

This code can be adapted for the other shipping methods that you use for UPS and FedEx ...

22 Jan 2015, 7:03 PM
#9
ajeh avatar

ajeh

Oba-san

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

Re: Shipping - restrict carriers/options per Catagory

For FedEx and UPS something like this for UPS:
/includes/modules/shipping/ups.php

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

[B]// bof: only allow for master_categories_id 2 & 3
if (!IS_ADMIN_FLAG) {
  $chk_categories = 0;
  $chk_categories += $_SESSION['cart']->in_cart_check('master_categories_id','2');
  $chk_categories += $_SESSION['cart']->in_cart_check('master_categories_id','3');
  if ($_SESSION['cart']->count_contents() != $chk_categories) {
//    $this->enabled = false;
  }
}
// eof: only allow for master_categories_id 2 & 3
[/B]
    if ($this->enabled) {
      // check MODULE_SHIPPING_UPS_HANDLING_METHOD is in