You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
First, Store / Shipping / Custom Shipping Methods use to create a custom shipping script. For the script's identifier, you can use anything you like, but we'll use 'uspscustom' here. Enter 'USPS Custom' for the Display Name, and the following for the Shipping Method PHP Content:
<?php $info = $this->globals('ecom.customship'); $custom = array(); $freeshipamt = $this->globals('core_settings.ecom.freeshipamt'); if (($info['country'] == 'United States') && ($info['total'] >= $freeshipamt) && ($freeshipamt > 0)) { $custom = array('Free US Shipping' => 0); } else { $delinfo = array('stateprov' => $info['stateprov'], 'country' => $info['country'], 'postalcode' => $info['postalcode'], 'rescom' => $info['rescom'], 'shipstateprov' => $info['shipstateprov'], 'shipcountry' => $info['shipcountry'], 'shipzip' => $info['shipzip'], 'shipmethods' => 'USPS', 'shiptype' => 'R'); $result = $this->include_namespace('ecom','shiprealtime',array('delinfo' => $delinfo, 'packages' => $info['packages'])); foreach ($result as $num => $service) {$custom[$service['name']] = $service['amount'];} } // End of if statement. $this->globals('ecom.customship_response',$custom); $this->globals('ecom.ship_freehandled',1); ?>
Next, you need to assign all your inventory items to this script, you said they they were using USPS via Realtime currently. You want every inventory item under Store / Inventory / Inventory Items to use 'USPS Custom' for it's 'Custom Shipping: Method' under the Delivery - Custom tab, and you'll want every one of those items to use a 'Delivery Method' of Custom Shipping under the Delivery - Config tab. You can do this one-by-one using the management interface, or access System / Database / Raw Database Admin and choose to Submit a Raw SQL Statement to update all items at once. Here is the statement to submit:
UPDATE ecom_inventory SET delmethod='C', customship='uspscustom'
Note: This updates all inventory items, be careful only to do this if you mean it. Finally, you'll want to empty your shopping cart to removed cached shipping info in it that may be there, then add a few fresh items to your cart and test. The only other thing to mention is the above script uses the 'Free Shipping: Threshold' setting under Store / Component / Settings / Shipping Settings, so you can increase the amount or turn this feature off from there.
Offline
Nick I set this up and testing a couple of products. In Store / Component / Settings / Shipping Settings. when I set Free Shipping: Threshold to 0.00 it is still giving Free Shipping ? I want to be able set Free Shipping: Threshold on a Dollar amount be able to turn it on and off.
Thanks, Gary
Last edited by gfrracing (09-18-2017 15:01:05)
Offline
I edited the custom script above. Please copy it again and try it. Now it checks to be sure the free shipping amount is greater than zero before triggering free shipping.
Offline