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.
With the new rules regarding exports meaning more time processing the orders, is it possible to have a minimum order value for non UK orders, say £20? I have a custom shipping script applied to all products which offers free shipping within the UK on orders over £20 and normal shipping rates on orders outside the UK. Is it possible to add something to this?
<?php $info = $this->globals('ecom.customship'); if ((($info['country'] == 'United Kingdom')) && ($info['total'] >= 20) ) { $custom = array('Standard Delivery 2-4 Business Days' => 0, 'Express Delivery 1-2 Business Days' => 2.08); } else { $ECOM_Ship =& $this->quick_object('ECOM_Ship','ecom'); $zonearray = array('weight' => $info['weight'], 'total' => $info['total'], 'country' => $info['country'], 'postalcode' => $info['postalcode']); $rateinfo = $ECOM_Ship->getrates_zone($zonearray,$info['packages']); foreach ($rateinfo as $ratenum => $ratedata) { $custom[$ratedata['name']] = $ratedata['amount']; } // End of foreach tatement. } // End of if statement. $this->globals('ecom.customship_response',$custom); ?>
Offline
It's not easy to implement a UK-only order minimum, however are you open to adding a UK-only order surcharge for orders under £20? Perhaps the difference between the total and £20?
Offline
yes that could be a possibility, however, the surcharge needs to be on "non UK" orders i.e. orders we send from the UK to other countries.
Offline
Add a Custom Surcharge Script using Store / Commerce / Custom Surcharge Methods with this logic:
<?php $cartids = $this->globals('ecom.checkout_cartids'); $country = $this->globals('core_session.country'); if (!(preg_match('/^UK /',$country))) {return 1;} $subtotal = 0; foreach ($cartids as $cartid => $item) {$subtotal += ($item['subtotal'] * 1.20);} if ($subtotal >= 20) {return 1;} $this->globals('ecom.total_customsurcharge',(20 - $subtotal)); $this->globals('ecom.customsurcharge_text','Non-UK Minimum Order Charge'); ?>
Note the item subtotal * 1.20 adds VAT back into the subtotal for the total calc. You might want that, or you might not. Then activate the script using the Custom Surcharge method and status settings managed with Store / Component / Settings / Checkout.
Offline