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 03-03-2009 14:59:09

jherr
Member
Registered: 09-12-2008
Posts: 26

add shipping message

Right now I have a simple custom shipping script based on weight. I would like to use this for all shipping in the UK and then add code which would display "We will notify you with shipping charges" to all deliveries outside of the UK.

I found a few examples of this in the forum but when I added any of these to my script it did not seem to make any difference. Can someone please tell me where I'm going wrong. This is the last script that I tried:

Code:

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


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')||($info['country'] == 'UK - Northern Ireland')){
// UK shipping

$method  = 'UK Delivery';
if ($weight <= 10) {
    $total = 7.50;
}
if ($weight > 10) {
    $total = 7.50 + (.25 * ($weight - 10));
}
$custom = array($method => $total);

} else {
// Rest of the world 
$method  = 'World Delivery';

     $ship_meth_name = "We will notify you with shipping charges";
     $ship_total = "0.00";
     $ship_display = "$ship_meth_name";
}

$custom_code_result = "";
$custom_code_result .= <<ENDOFTEXT;
<INPUT TYPE="RADIO" NAME="shipinfo-$shipid" VALUE="$ship_meth_name:$ship_total" CHECKED> <FONT FACE="$html_base_font_face" SIZE="$html_base_font_size" COLOR="$html_base_font_color"> $ship_display<BR></FONT>
ENDOFTEXT

Thanks

Offline

 

#2 03-03-2009 15:47:21

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

Re: add shipping message

What you have posted is trying to create a display, which is a mix between 5.1 and 6 but mostly for ccp5.1 and not ccp6, totally different animal.

John

Offline

 

#3 03-03-2009 16:12:54

jherr
Member
Registered: 09-12-2008
Posts: 26

Re: add shipping message

Thanks, I was just picking up pieces that I found in the forum but having very little understanding of what I was doing. Can you tell me if this can be altered so that it works with ccp6?

Offline

 

#4 03-03-2009 23:34:08

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

Re: add shipping message

Try this

Code:

<?php

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


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')||($info['country'] == 'UK - Northern Ireland')){
// UK shipping

$method  = 'UK Delivery';

   if ($weight <= 10) {

       $total = 7.50;

    } else {

       $total = 7.50 + (.25 * ($weight - 10));

     } // end of if statement.

 } else {

// Rest of the world 
$method  = 'World Delivery';

     $method = "We will notify you with shipping charges";
     $total = "0.00";
     
} // End of if statement.

$custom = array($method => $total);

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

?>

With a total of zero or null tho it will get displayed as free on the checkout page.

John

Offline

 

#5 03-04-2009 00:29:30

jherr
Member
Registered: 09-12-2008
Posts: 26

Re: add shipping message

Thanks John, this works a lot better than anything I've tried so far. Actually this is the only one that has worked at all.  Is there any way to remove the "-Free" from the end of the "we will notify you..." message on the checkout page?
This is just a temporary solution, I'm looking for someone that I can hire to set up a proper custom shipping but have had no luck yet. At least now with this script I don't have to take a huge loss with each international order.

Offline

 

#6 03-04-2009 00:53:50

jherr
Member
Registered: 09-12-2008
Posts: 26

Re: add shipping message

I found where to remove the "Free". Thanks again for the help.

Offline

 

#7 01-08-2010 17:13:06

nyborlily
Member
Registered: 09-23-2009
Posts: 65

Re: add shipping message

So where do you remove the "Free"?

Offline

 

Board footer