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.
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:
$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
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
Try this
<?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
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
I found where to remove the "Free". Thanks again for the help.
Offline
So where do you remove the "Free"?
Offline