skip to content
AdaWiki
User Tools
Log In
Site Tools
Search
Tools
Show page
Old revisions
Backlinks
Recent Changes
Media Manager
Sitemap
Log In
>
Recent Changes
Media Manager
Sitemap
You are here:
start
»
tutorials
»
zencartmods
»
usps_300.html
Trace:
tutorials:zencartmods:usps_300.html
====== Forcing shipping method by value ====== We ship via UPS and USPS (postal). Postal is great, inexpensive and fairly fast. One thing it isn't is automatically insured or tracked. Because of this we externally insure all packages including USPS but still, we found that shipping expensive things by USPS was not a great idea. That's what UPS is for, which is a trackable service that has better systems in place for valuables. So, for orders over $200, we force domestic customers to use UPS as opposed to USPS. Here's how to set an arbitrary limit on the usps shipping module. {{:tutorials:zencartmods:limit.png}} === Notes === Make sure that you have other shipping options enabled! Don't disable USPS without any good alternatives. Also, UPS can't ship to PO Boxes. If shipping expensive things to PO Boxes is important for your business, don't do this mod! ==== includes/languages/english/modules/shipping/usps.php ==== add these lines <code> define('MODULE_SHIPPING_USPS_LIMIT_ERROR', 'For packages over $200 we require shipment via UPS'); define('MODULE_SHIPPING_USPS_LIMIT', 200); </code> Change 200 to whatever you want the limit to be! ==== includes/modules/shipping/usps.xml ==== Find line 188 <code php> if (is_array($uspsQuote)) { </code> and replace with <code php> if (is_array($uspsQuote) && $_SESSION['cart']->total < MODULE_SHIPPING_USPS_LIMIT) { </code> Find line 281 <code php> elseif ($uspsQuote == -1) { $this->quotes = array('module' => $this->title, 'error' => MODULE_SHIPPING_USPS_TEXT_SERVER_ERROR . (MODULE_SHIPPING_USPS_SERVER=='test' ? MODULE_SHIPPING_USPS_TEXT_TEST_MODE_NOTICE : '')); } </code> and replace with <code php> elseif ($uspsQuote == -1) { $this->quotes = array('module' => $this->title, 'error' => MODULE_SHIPPING_USPS_TEXT_SERVER_ERROR . (MODULE_SHIPPING_USPS_SERVER=='test' ? MODULE_SHIPPING_USPS_TEXT_TEST_MODE_NOTICE : '')); } elseif ($_SESSION['cart']->total > MODULE_SHIPPING_USPS_LIMIT) { $this->quotes = array('module' => $this->title, 'error' => MODULE_SHIPPING_USPS_LIMIT_ERROR); } </code>
/home/ladyada/public_html/wiki/data/pages/tutorials/zencartmods/usps_300.html.txt
· Last modified: 2016/01/28 18:05 (external edit)
Page Tools
Show page
Old revisions
Backlinks
Back to top