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 07-05-2010 11:42:17

jonasaedin
Member
From: Edinburgh, UK
Registered: 02-15-2009
Posts: 70
Website

Shipping - delivery charge on request

I am trying to update the shipping charges for my clients site - we are currently using a priced 'by destination' custom shipping method which works well, however now the client wants a seperate custom shipping script for bulky items. The problem is that they want some countries to call for shipping prices ie:

UK - 9.95
N ire - 14.95
R ire - 24.95
EU - Price on request
ROW - Price on request

Is this possible to to within a Custom Shipping method?

The Script I currently use for normal items:

Code:

<?php 

// +--
// | All custom shipping scripts work in the same way.  A global
// | variable named 'ecom.customship' contains the following PHP
// | array.  Array keys with value info:
// |
// | weight     => Total weight of items being shipped.
// | total      => Subtotal of items being shipped.
// | quantity   => Quantity of items being shipped.
// | stateprov  => Ship to state/province.
// | country    => Ship to country.
// | postalcode => Ship to postal code.
// | rescom        => Ship to residential/commercial status.
// | shipstateprov => Ship origin state/province.
// | shipcountry   => Ship origin country.
// | shipzip       => Ship origin postal code.
// | packages      => An array containing all packages with
// |                  each package defined in it's own array
// |                  with keys: length, width, height, weight.
// | delinfo       => Delivery information array.
// | delitems      => An array containing all items with
// |                  each item id as a key and the item quantity 
// |                  as a value.
// |
// | This script must set a global variable named 
// | 'ecom.customship_response' which is an array in the 
// | following format:
// |
// | method name => amount
// |
// | NOTE: Do not print anything within custom shipping
// | scripts.  They are designed only to return names and 
// | prices for custom shipping methods.
// |
// | This script is a Percentage of Total Item Cost script that
// | returns a prices based on a percentage of the total item cost.
// +--

$info = $this->globals('ecom.customship');

if (($info['country'] == 'UK - England & Wales')||($info['country'] == 'UK - Scotland Mainland')||($info['country'] == 'UK - Highlands & Islands Scotland')||($info['country'] == 'UK - Isle of Man')||($info['country'] == 'UK - Channel Islands')){
// UK shipping
$method  = 'UK Delivery';
$total = '4.95';
$custom = array($method => $total);

} elseif (($info['country'] == 'UK - Northern Ireland')){
// European counties charge 
$method  = 'Northern Ireland Delivery';
$total = '9.95';
$custom = array($method => $total);


} elseif (($info['country'] == 'Ireland')){
// European counties charge 
$method  = 'Rep. of Ireland Delivery';
$total = '19.95';
$custom = array($method => $total);


} elseif (($info['country'] == 'Cyprus')||($info['country'] == 'Finland')||($info['country'] == 'Gibraltar')||($info['country'] == 'Hungary') ||($info['country'] == 'Iceland')||($info['country'] == 'Norway') ||($info['country'] == 'Poland')||($info['country'] == 'San Marino')||($info['country'] == 'Slovenia') ||($info['country'] == 'Switzerland')||($info['country'] == 'Austria') ||($info['country'] == 'Belgium')  ||($info['country'] == 'Denmark') ||($info['country'] == 'France') ||($info['country'] == 'Germany') ||($info['country'] == 'Greece') ||($info['country'] == 'Italy') ||($info['country'] == 'Luxembourg') ||($info['country'] == 'Netherlands') ||($info['country'] == 'Portugal') ||($info['country'] == 'Spain') ||($info['country'] == 'Sweden')){
// European counties charge 
$method  = 'European Delivery';
$total = '29.95';
$custom = array($method => $total);


} else {
// Rest of the world £6.0
$method  = 'World Delivery';
$total = '40.00';
$custom = array($method => $total);

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

Thanks

Offline

 

#2 07-05-2010 12:14:15

Graham
Member
Registered: 09-30-2004
Posts: 981
Website

Re: Shipping - delivery charge on request

It shouldn't be too difficult, all you need is to trap the required locations using IF statements and give them a method of "Price on Request" and a total of zero.

Then when it prints out the price, check if method is "Price on Request" and, if so, don't print the total.

Offline

 

Board footer