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 09-03-2012 06:36:02

Enox
Member
Registered: 06-12-2008
Posts: 69

Custom Shipping Method

Hi,
Ive been looking over the forum to find a shipping method and dont seem to be able to get started.

All i need is two options for the customers:

2-5 Days = Free

Next Day = £5

For UK orders.

I dont ship to any other country as of yet.

Is there any chance someone could help me out? or point me in a direction where i can learn how to make one?

Enox

Offline

 

#2 09-03-2012 09:06:17

Enox
Member
Registered: 06-12-2008
Posts: 69

Re: Custom Shipping Method

There are no extra details required, no weight / length parameters, no surcharges just two simple methods.
unfortunately not simple enough for me to get right. ><

Offline

 

#3 09-03-2012 23:27:41

dh783
Member
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: Custom Shipping Method

In it''s simplest form:

Code:

<?php 

$custom = array('2-5 Days' => '0.00', 'Next Day' => '5.00');

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

?>

or for country only

Code:

<?php 

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

 if ($info['country'] == 'United Kingdom') {

   $custom = array('2-5 Day s' => '0.00', 'Next Day' => '5.00');

 } // end of if statement.

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

?>

But the last example holds no action for an order that doesn't match the country so it will only produce a shipping error (since no shipping amount or method is created) at which time the default rate will be pulled. No matter what you put in a custom shipping script it will not void or stop an order, it either creates the shipping amounts or pulls the default shipping amount on an error.


John

Offline

 

#4 09-04-2012 10:34:58

Enox
Member
Registered: 06-12-2008
Posts: 69

Re: Custom Shipping Method

Hi John.

Sincere thanks!

Offline

 

#5 10-30-2012 11:58:10

Commsman
Member
From: Nottingham UK
Registered: 09-08-2004
Posts: 60
Website

Re: Custom Shipping Method

Hi

Can I adapt this to provide additional shipping options for my UK customers:

Current  shipping method code:
if (($info['country'] == 'UK - England & Wales')||($info['country'] == 'UK - Scotland Mainland')){
$method  = 'UK Standard Delivery';
if ($info['total'] > '0' && $info['total'] <= '9.99') {
  $custom = array($method => '3.95');
} elseif ($info['total'] > '9.99' && $info['total'] <= '39.99') {
  $custom = array($method => '6.95');
} elseif ($info['total'] > '39.99') {
  $custom = array($method => '3.95');
} else {
  $custom = array($method => '0.00');
}
}

If I understand correctly, all I need to do is add the options into the array:
e.g.:
if ($info['total'] > '0' && $info['total'] <= '9.99') {
  $custom = array($method => '3.95','Delivery before 10am' => '8.95', 'Delivery before 12pm' => '6.95');
...etc. etc.

Am I right?

Regards

Julian

Offline

 

Board footer