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 12-16-2010 09:39:46

victoria@luna-nova.co.uk
Member
Registered: 09-28-2010
Posts: 70

shipping per item

I have a custom shipping script set up and it works brilliant, how every I would like it so that the customer has to pay for each items delivery charge.

they are gift boxes and at the moment if someone orders 3 they only pay 1 delivery charge sad its costing alot to me  here is the current script, i be grateful if anyone knows?????


<?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 User Defined Calculation script that
// | returns a static method and amount.
// +--

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

if (($info['country'] == 'UK - England & Wales')||($info['country'] == 'UK - Scotland Mainland')){
// UK Zone 1
$method  = 'UK Mainland Zone 1 Delivery';
$total = '5.99';
$custom = array($method => $total);

} elseif (($info['country'] == 'UK - Highlands & Islands Scotland')||($info['country'] == 'UK - Isle of Man')||($info['country'] == 'UK - Channel Islands')){
// UK Zone 2
$method  = 'UK Zone 2 Delivery';
$total = '5.99';
$custom = array($method => $total);

} elseif (($info['country'] == 'UK - Northern Ireland')){
// UK Zone 3
$method  = 'UK Zone 3 Delivery';
$total = '5.99';
$custom = array($method => $total);

} elseif (($info['country'] == 'Republic of Ireland')){
// UK Zone 4
$method  = 'UK Zone 4 Delivery';
$total = '12.00';
$custom = array($method => $total);

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



I have no script knowledge I got this of another post!

smile


It's what's inside that counts...

Offline

 

#2 12-16-2010 11:08:37

vbsaltydog
Member
From: Florida
Registered: 05-02-2005
Posts: 947
Website

Re: shipping per item

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

if (($info['country'] == 'UK - England & Wales')||($info['country'] == 'UK - Scotland Mainland')){
// UK Zone 1
$method  = 'UK Mainland Zone 1 Delivery';
$total = ('5.99' * $info['quantity']);
$custom = array($method => $total);

} elseif (($info['country'] == 'UK - Highlands & Islands Scotland')||($info['country'] == 'UK - Isle of Man')||($info['country'] == 'UK - Channel Islands')){
// UK Zone 2
$method  = 'UK Zone 2 Delivery';
$total = ('5.99' * $info['quantity']);
$custom = array($method => $total);

} elseif (($info['country'] == 'UK - Northern Ireland')){
// UK Zone 3
$method  = 'UK Zone 3 Delivery';
$total = ('5.99' * $info['quantity']);
$custom = array($method => $total);

} elseif (($info['country'] == 'Republic of Ireland')){
// UK Zone 4
$method  = 'UK Zone 4 Delivery';
$total = ('12.00' * $info['quantity']);
$custom = array($method => $total);

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


Latest CCP 7 XMods Available:


Offline

 

#3 12-17-2010 08:38:02

victoria@luna-nova.co.uk
Member
Registered: 09-28-2010
Posts: 70

Re: shipping per item

Hi

I tried the script but its still only listing 1 delivery cost for 2 items?

sad


is there something somewhere else i need to do?

thanks


It's what's inside that counts...

Offline

 

#4 12-17-2010 08:42:46

victoria@luna-nova.co.uk
Member
Registered: 09-28-2010
Posts: 70

Re: shipping per item

as a quick note, Ive gone into individual products and in shipping section chosen number of boxes to be shipped in and selected one!

not sure why previous code didnt work? :s
smile smile smile

thanks!


It's what's inside that counts...

Offline

 

#5 12-17-2010 09:59:02

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

Re: shipping per item

Any items that is set to ship with others will only ship by itself if it is the only item being purchased or it is the last item and will not fit within the package size limits of the shipper, otherwise it will be included into a package with other items in the order. In your posted problem the custom ship scripts are dealing with packages, so all items have been group together per destination and set as packages, then the custom ship script is called to produce shipping amounts.

John

Offline

 

#6 12-17-2010 13:43:30

vbsaltydog
Member
From: Florida
Registered: 05-02-2005
Posts: 947
Website

Re: shipping per item

There are ways to iterate over the items in the global array and calculate your shipping as requested. Im sure that Kryptronic support, Dave, John or Myself can do this for you for a small fee.


Latest CCP 7 XMods Available:


Offline

 

#7 12-17-2010 14:35:52

victoria@luna-nova.co.uk
Member
Registered: 09-28-2010
Posts: 70

Re: shipping per item

Hi

Thanks for quick reply!

I will have a think about that! However, wouldn't mind a quote for some script changes to the splash page.

I've got categories on the front (there's another post with the challenges on)

I want to change the width of the boxes of my categories but in doing so will stretch the front ones.
Bruce suggested mimicing the boxes with links and table etc on the front page so I can change the other boxes.

Am sure its an oooober simple process for you guys as ur experts! wink

Any clue on costing for this?

Thanks in advance!


It's what's inside that counts...

Offline

 

#8 12-17-2010 14:42:07

vbsaltydog
Member
From: Florida
Registered: 05-02-2005
Posts: 947
Website

Re: shipping per item

Please request quotes via PM and dont forget about the Kryptronic Custom Shop too.


Latest CCP 7 XMods Available:


Offline

 

#9 12-17-2010 14:49:43

victoria@luna-nova.co.uk
Member
Registered: 09-28-2010
Posts: 70

Re: shipping per item

Thanks vbsaltydog!

What's pm? And not visited custome shop so will have a look tomorrow smile

Thanks!


It's what's inside that counts...

Offline

 

#10 12-17-2010 15:31:22

vbsaltydog
Member
From: Florida
Registered: 05-02-2005
Posts: 947
Website

Re: shipping per item

PM = private message

or via email.

There are PM and email links in the forum posts under the poster's name.

Last edited by vbsaltydog (12-17-2010 15:31:50)


Latest CCP 7 XMods Available:


Offline

 

Board footer