Zen Cart Logo
Forums / Built-in Shipping and Payment Modules / Making shipping options dependant on price or weight

Making shipping options dependant on price or weight

Locked

Views: 858

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
5 Nov 2010, 2:47 PM
#1
commdiver avatar

commdiver

Zen Follower

Join Date:
May 2010
Posts:
222
Plugin Contributions:
0

Making shipping options dependant on price or weight

Is there a way to allow a shipping option to only appear if customers checkout for a certain price? I sell soaps. I would like to offer customers the option to select a flat rate if they only order one bar of soap. For example, if I wanted to offer Fed Ex ground to anyone purchasing something more than $100 or weighing more than ten pounds, how would I do that (just an example, I actually want to use a flat rate)?

Is there a way to do this? Thank you for any help.

5 Nov 2010, 3:00 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Making shipping options dependant on price or weight

The display of the shipping modules is controlled by the:
$this->enabled

in each module ...

You can test the shopping cart and based on the Total and Weight control the settings of the $this->enabled to turn them on and off ...

What shipping modules are you actually using? :unsure:

You might also look at the threads at the bottom of this one for examples ...

5 Nov 2010, 5:44 PM
#3
commdiver avatar

commdiver

Zen Follower

Join Date:
May 2010
Posts:
222
Plugin Contributions:
0

Re: Making shipping options dependant on price or weight

Ajeh:

The display of the shipping modules is controlled by the:
$this->enabled

in each module ...

You can test the shopping cart and based on the Total and Weight control the settings of the $this->enabled to turn them on and off ...

What shipping modules are you actually using? :unsure:

You might also look at the threads at the bottom of this one for examples ...

I am using the USPS shipping module.

Where do I find "$this->enabled"? I want to use flat.php for flat rate. I want the flat rate to be $5, but I want the shipping module to only appear if the order is below $X.YZ. The reason being, one bar of soap will ship in a small flat rate USPS box, but ten will obviously not fit in the $5 small flat rate box.

Thank you for the help so far :smile:

5 Nov 2010, 5:52 PM
#4
commdiver avatar

commdiver

Zen Follower

Join Date:
May 2010
Posts:
222
Plugin Contributions:
0

Re: Making shipping options dependant on price or weight

I guess I could just use the Per Item shipping module. I still would like to know how to hide it, though. I do not want someone with a large order seeing a really high shipping charge.

5 Nov 2010, 10:43 PM
#5
ajeh avatar

ajeh

Oba-san

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

Re: Making shipping options dependant on price or weight

If you look at some of the related topics below this thread, you should see you can use something like:

Example, to not show when weight is less than 20 ...

if (IS_ADMIN_FLAG == false && $_SESSION['cart']->show_weight() < 20) {
  $this->enabled = false;
} else {
  $this->enabled = true;
} 

This code would be placed, for example, in the Flat Rate flat shipping module for:
/includes/modules/shipping/flat.php

just below the code:

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