Zen Cart Logo
Forums / Built-in Shipping and Payment Modules / Specified shipping for Specified products?

Specified shipping for Specified products?

Views: 3,070

Results 1 to 20 of 25
10 Mar 2011, 6:44 PM
#1
joshuaove avatar

joshuaove

New Zenner

Join Date:
Mar 2011
Posts:
12
Plugin Contributions:
0

Specified shipping for Specified products?

v. 1.3.9h
Current and default USPS shipping module installed and enabled.
Store Pick Up installed and enabled. Flat Rate installed, but disabled.

Our store( http://www.ourvitalearth.com/zcart ) currently (using USPS) offers both parcel post and priority for all domestic address'. However, we sell live worms, and they MUST ALWAYS ship priority.

How do I disable the parcel post option when this item is found in cart during checkout?
How do I enable ONLY Flat Rate for a different product we offer?

Thanks in advance, :blink:
Josh

11 Mar 2011, 7:43 AM
#2
igofresh avatar

igofresh

Zen Follower

Join Date:
Oct 2010
Posts:
149
Plugin Contributions:
0

Re: Specified shipping for Specified products?

Crazy idea:
depending on your other modules, you could make worms weight an inflated weight (like 1000lbs each) and set other modules to not ship over 1000lbs. then set a table rate for the worms? I would disable display of weights so you dont freak out your customers.

11 Mar 2011, 4:00 PM
#3
joshuaove avatar

joshuaove

New Zenner

Join Date:
Mar 2011
Posts:
12
Plugin Contributions:
0

Re: Specified shipping for Specified products?

Great ideas can seem crazy sometimes....

The problem is, priority and parcel post are under the same USPS module. How can one change or divide that module for my needs?

12 Mar 2011, 7:50 AM
#4
igofresh avatar

igofresh

Zen Follower

Join Date:
Oct 2010
Posts:
149
Plugin Contributions:
0

Re: Specified shipping for Specified products?

I'm not sure, but cant you set priority as required for certain conditions
like weight?

12 Mar 2011, 2:08 PM
#5
johnniejetski avatar

johnniejetski

New Zenner

Join Date:
Jan 2011
Posts:
66
Plugin Contributions:
0

Re: Specified shipping for Specified products?

I have a similar issue, I would like to offer flat rate on all my items , except one category, which is much heavier and needs to go through the calculated USPS/UPS

any idea how to do this? flat rate has no option for max weight

12 Mar 2011, 4:39 PM
#6
ajeh avatar

ajeh

Oba-san

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

Re: Specified shipping for Specified products?

If you have all of the Products in that 1 Category set to use it as the Master Category (master_categories_id) then you can test the cart to see if 1 or more are in the cart with:

$chk_cat = $_SESSION['cart']->in_cart_check('master_categories_id','10');

where 10 is the master_categories_id ...

Then, you can control the $this->enabled based on the results ...

If 1 Product is in the Category, then the whole order would be shipped USPS or UPS ...

If you need to disable the UPS and USPS if none are in the cart, you can reverse the test ...

14 Mar 2011, 7:53 PM
#7
joshuaove avatar

joshuaove

New Zenner

Join Date:
Mar 2011
Posts:
12
Plugin Contributions:
0

Re: Specified shipping for Specified products?

Ajeh:

If you have all of the Products in that 1 Category set to use it as the Master Category (master_categories_id) then you can test the cart to see if 1 or more are in the cart with:

$chk_cat = $_SESSION['cart']->in_cart_check('master_categories_id','10');

> 
> where 10 is the master_categories_id ...
> 
> Then, you can control the $this->enabled based on the results ...
> 
> If 1 Product is in the Category, then the whole order would be shipped USPS or UPS ...
> 
> If you need to disable the UPS and USPS if none are in the cart, you can reverse the test ...
According to db (Nature's Solution 5oz) is products_id 6 and according to zen-cart it is the only thing in it's own catagory 2.  This is the only product and or catagory I want to be Flat Rate shipable.   

How or where do I "set to use it as the Master Category (master_categories_id)"?  Also, the code you provided above, is this an edit to the flat.php file located includes/modules/shipping ?


Regarding USPS and Live worms: I think this issue is a lil more involved, since I want a quote for USPS PRIORITY only, when this item is ordered.
14 Mar 2011, 8:19 PM
#8
ajeh avatar

ajeh

Oba-san

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

Re: Specified shipping for Specified products?

What happens if I put that Flat Rate Product with other products?

14 Mar 2011, 8:26 PM
#9
joshuaove avatar

joshuaove

New Zenner

Join Date:
Mar 2011
Posts:
12
Plugin Contributions:
0

Re: Specified shipping for Specified products?

I would like it to be calculated separatley. However, I thought I'd start with getting Flat Rate to turn on and off based on that product.

15 Mar 2011, 8:19 PM
#10
joshuaove avatar

joshuaove

New Zenner

Join Date:
Mar 2011
Posts:
12
Plugin Contributions:
0

Re: Specified shipping for Specified products?

Works like this:
"Walk-In" for all products

If, products_id 6 (in it's own category 2) is found in cart, then "Flat Rate" this product only and calculate remaining items in the common/normal modes: walkin, USPS (priority, parcel post, international)

and

If, products_id 4 (in category 1 with others) is found in cart, then "USPS" **priority only **and only for that item. Remaining items calculate using the common/normal modes: walkin, Flat Rate, USPS (priority, parcel post, international)

Thanks

15 Mar 2011, 10:49 PM
#11
ajeh avatar

ajeh

Oba-san

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

Re: Specified shipping for Specified products?

You would need to do quite a lot of customization for this as you are trying to mix shipping methods within the same order and this is not a feature, at this time, of the shipping ...

16 Mar 2011, 1:51 AM
#12
joshuaove avatar

joshuaove

New Zenner

Join Date:
Mar 2011
Posts:
12
Plugin Contributions:
0

Re: Specified shipping for Specified products?

I figured as much. I'm a quick learn...? Well, how do I Flat Rate only if that is the only item in cart? can i use products_id, or does it have to be in it's own catgry?

16 Mar 2011, 1:08 PM
#13
ajeh avatar

ajeh

Oba-san

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

Re: Specified shipping for Specified products?

You need to control the $this->enabled in the shipping modules ...

To turn off a module based on the total count does NOT equal to the total count in the cart you can use:

if (!IS_ADMIN_FLAG) {
  global $cart;
  $chk_count = $_SESSION['cart']->in_cart_check('products_id','12');
  if ($chk_count != $_SESSION['cart']->count_contents()) {
    $this->enabled = false;
  }
}

To turn off a module based on the total count DOES equal to the total count in the cart you can use:

if (!IS_ADMIN_FLAG) {
  global $cart;
  $chk_count = $_SESSION['cart']->in_cart_check('products_id','12');
  if ($chk_count == $_SESSION['cart']->count_contents()) {
    $this->enabled = false;
  }
}
16 Mar 2011, 6:30 PM
#14
joshuaove avatar

joshuaove

New Zenner

Join Date:
Mar 2011
Posts:
12
Plugin Contributions:
0

Re: Specified shipping for Specified products?

Thanks Ajeh and others who helped me kick around some ideas. I just turned Flat Rate module off based on not equal. :clap:

Now, how do you suggest handling LIVE Worms, that must have walk-in and only ship USPS PRIORITY not Parcel Post... Besides, Call when ordering?:unsure:

Thanks again for helping me with the flat rate issue.

16 Mar 2011, 6:40 PM
#15
ajeh avatar

ajeh

Oba-san

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

Re: Specified shipping for Specified products?

What should happen if Worms and other Products are in the same order? :unsure:

16 Mar 2011, 6:52 PM
#16
joshuaove avatar

joshuaove

New Zenner

Join Date:
Mar 2011
Posts:
12
Plugin Contributions:
0

Re: Specified shipping for Specified products?

Calculate all "Priority" no option for "Parcel Post" I'd like to do it detailed earlier. However, you stated, "You would need to do quite a lot of customization for this as you are trying to mix shipping methods within the same order and this is not a feature, at this time, of the shipping ..."

Can I disable parcel post, displaying PRIORITY only, if said item is found in cart?

16 Mar 2011, 7:08 PM
#17
ajeh avatar

ajeh

Oba-san

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

Re: Specified shipping for Specified products?

You could customize the code to check the worms in the order:

          [B]$cost = preg_replace('/[^0-9.]/', '',  $cost);[/B]
          // disable if worms are in the cart and shipping type is Parcel Post
          global $cart;
          $chk_worms = $_SESSION['cart']->in_cart_check('products_id','12');
          if ($chk_worms > 0 && $type != 'PRIORITY') {
            // do not display
          } else {
          $methods[] = array('id' => $type,
                             'title' => $title,
                             'cost' => ($cost * $shipping_num_boxes) + (MODULE_SHIPPING_USPS_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_USPS_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_USPS_HANDLING) );
          }
        }

 [B]       $this->quotes['methods'] = $methods;[/B]
16 Mar 2011, 7:25 PM
#18
joshuaove avatar

joshuaove

New Zenner

Join Date:
Mar 2011
Posts:
12
Plugin Contributions:
0

Re: Specified shipping for Specified products?

Where would I drop this?

after the
// disable only when entire cart is free shipping

and before
// check MODULE_SHIPPING_USPS_HANDLING_METHOD is in

??

16 Mar 2011, 7:50 PM
#19
ajeh avatar

ajeh

Oba-san

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

Re: Specified shipping for Specified products?

I set the two original lines in the code in bold ...

It is the code in between that is changed ...

16 Mar 2011, 8:05 PM
#20
joshuaove avatar

joshuaove

New Zenner

Join Date:
Mar 2011
Posts:
12
Plugin Contributions:
0

Re: Specified shipping for Specified products?

Duh, this working perfect. I will give text instructions regarding mixed carts. I tried and thanks for helping me. :hug: