Forums / Built-in Shipping and Payment Modules / Remove certain shipping options based on total price

Remove certain shipping options based on total price

Locked

Views: 1,256

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
3 Aug 2009, 4:09 PM
#1
mr_pibb avatar

mr_pibb

New Zenner

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

Remove certain shipping options based on total price

I couldnt' find any comments regarding this.

I'd like to restrict folks from using certian shipping options under certian situations. For example, for international orders I'd like to not allow the customers to select First Class Mail International if the order total is over $100. Even being able to edit the shipping option to state "First Class Mail International (only for orders under $100USD).

Is this possbile? Just an edit of some obscure buried .php file? :D

Thanks!
Tim

7 Aug 2009, 3:54 AM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Remove certain shipping options based on total price

You would need to suppress the quote for that in the shipping module itself for:
/includes/modules/shipping/usps.php
/includes/languages/english/modules/usps.php

evaluate against the $type as to whether or not to build the quote in the:

          $methods[] = array('id' => $type,
                             'title' => $title,
                             'cost' => ($cost + MODULE_SHIPPING_USPS_HANDLING) * $shipping_num_boxes);

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!

7 Aug 2009, 1:53 PM
#3
mr_pibb avatar

mr_pibb

New Zenner

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

Re: Remove certain shipping options based on total price

thanks for that info. I actually found something that worked for me but I posted my results in another thread and forgot to post them here.

I added a line immediately after this line in /includes/modules/shipping/usps.php :

if ($_SESSION['cart']->total > 400 && strstr($services[$i], 'Priority Mail International Flat Rate Envelope')) continue; // skip value > $400 Priority Mail International Flat Rate Envelope 

Here's what I added:

if ($_SESSION['cart']->total > 100 && strstr($services[$i], 'First Class Mail International Package')) continue; // skip value > $100 First Class Mail International PackageThe one that was already there says that if the value is over $400 then Priority Mail 
```International Flat Rate Envelope will no longer be an option.

Basically, I used the rule I found in there that prevents packages over $400 from being sent in an Priority Mail International Flat Rate Enveleope,  but mine makes First Class Mail International Package is no longer an option for purchases over $100.
7 Aug 2009, 4:23 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Remove certain shipping options based on total price

Thanks for the update on what worked for you ... :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!