Kryptronic Software Support Forum

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.

#1 05-01-2020 08:06:58

sqm24
Member
Registered: 01-24-2018
Posts: 24

Varying Free Shipping Threshold

Hi,

We are currently setting up shipping rules based on zones. Iíve have been making adjustments to them base on what we already offer which are simpler than the Parcelforce ones you supplied in the CSVís. I have used the Free Shipping Threshold, however, we have a different thresholds for different zones, the lowest being UK mainland and the highest being some European countries, with others having no free shipping. At the moment it just offers the lowest shipping with free deliver regardless of the country itís shipping to.

Iíve seen in another forum topic a mod that was for real time shipping which did something similar. Is that the way to go or is it custom shipping? I still want to utilise the zones though so I assume that custom shipping is not the way to go.

Thanks

Offline

 

#2 05-04-2020 09:11:47

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19558
Website

Re: Varying Free Shipping Threshold

Use custom shipping for the inventory items and something like this for your custom shipping script.  Adjust as necessary:

Code:

<?php 

$info      =  $this->globals('ecom.customship');
$custom    =  array();
$freeloc   =  array('United States', 'Canada');
$freeset   = 0;

$ECOM_Ship =& $this->quick_object('ECOM_Ship','ecom');

$zonearray  = array('weight' => $info['weight'], 'total' => $info['total'], 'country' => $info['country'], 'postalcode' => $info['postalcode']);
$zone_rates = $ECOM_Ship->getrates_zone($zonearray,$info['packages']);

foreach ($zone_rates as $num => $rateinfo) {

     if ((in_array($info['country'],$freeloc)) && (empty($freeset))) {

          $freeset            = 1;
          $rateinfo['amount'] = 0;

          $this->globals('ecom.ship_freehandled',1);

     } // End of if statement.

     $custom[$rateinfo['name']] = $rateinfo['amount'];

} // End of if statement.

// +--
// | Globalize result
// +-- 

$this->globals('ecom.customship_response',$custom);

?>

Nick Hendler

Offline

 

#3 05-04-2020 10:38:13

sqm24
Member
Registered: 01-24-2018
Posts: 24

Re: Varying Free Shipping Threshold

Thanks for that.

I've still got some changes to make to the zones to fit how we are charging the diferent zones. So I will get that all that before I take a look at your example code, but it looks like it will do what we want.

Offline

 

Board footer