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 02-10-2013 12:43:34

jonsidneyb
Member
Registered: 06-07-2006
Posts: 158

Custom Shipping Script question.

I know this is not a Kryptronics question but will ask anyway.



I am not a coder and I am always afraid I will break something.  I cannot reach the person that did this for me.

I use flat rate shipping and shipping has gone up.

On domestic  shipping I give free shipping when the order is $90.00 and up.  I am going to change that to $100.00

I was just going to change 90 to 100 but noticed there was an 89.99 in there.  Would I be changed this to 99.99 where 89.99 was and change 90 to 100?

I assume every place I see standard carrier to add the new rates.

<?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 Calculation On Total Item Cost script that
// | returns a prices based on total item cost.
// +--

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

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

    if ($info['total'] >= '0' && $info['total'] <= '89.99') {

     $custom = array('Standard Carrier' => '5.00');

    } elseif ($info['total'] >= '90.00') {

     $custom = array('Free Shipping' => '0.00');

    }//End of if.

} elseif ($info['country'] == 'Canada') {

$custom = array('Standard Carrier' => '12.00');

}else {

$custom = array('Standard Carrier' => '14.00');

} // End of if statement.

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

?>

Offline

 

#2 02-10-2013 16:40:14

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

Re: Custom Shipping Script question.

the answers to your questions are yes.

John

Offline

 

#3 02-10-2013 19:00:14

jonsidneyb
Member
Registered: 06-07-2006
Posts: 158

Re: Custom Shipping Script question.

Thanks

Offline

 

Board footer