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 01-09-2018 02:17:32

Cww2
Member
Registered: 08-15-2008
Posts: 119

I am still having shipping issues and can not find the error

This is my code
Calculation On Total Item Cost

<?php

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

$ship_name  = 'Standard Shipper';
$ship_total = 0;

if      ($info['total'] <= 15)   {$ship_total = 7.95;}
elseif  ($info['total'] <= 30)   {$ship_total = 8.95;}
elseif  ($info['total'] <= 50)   {$ship_total = 9.95;}
elseif  ($info['total'] <= 75)   {$ship_total = 10.95;}
elseif  ($info['total'] <= 100)  {$ship_total = 11.95;}
elseif  ($info['total'] <= 125)  {$ship_total = 12.95;}
elseif  ($info['total'] <= 200)  {$ship_total = 14.95;}
else                             {$ship_total = 16.00;}

if ($info['country'] == 'Canada') {$ship_total = $ship_total + 28.95;}

$canadian_method = 'For Canadian orders of small items (all items must fit within a video box or regular shipping rates apply) please choose this option (no tracking and no insurance)';

$canadian_total = '28.95';

$this->globals('ecom.customship_response',array($ship_name => $ship_total, $canadian_method => $canadian_total));

?>

Item Subtotal    $110.49
Delivery Total    $20.90
State/Province Tax Total    $6.12
Total    $137.51
Nebraska order

Shipping should have been 12.95

Item Subtotal    $150.60
Delivery Total    $22.90
Total    $173.50
MN order

Shipping should have been 14.95

SO where might the problem be?

Offline

 

#2 01-09-2018 04:14:50

zanart
Member
From: bedford
Registered: 04-02-2008
Posts: 1642
Website

Re: I am still having shipping issues and can not find the error

have you got the product set to the correct shipping method?


- Euorpacart 8

Offline

 

#3 01-09-2018 08:06:39

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19512
Website

Re: I am still having shipping issues and can not find the error

That's what I'm thinking.  The products aren't using this method.  If they are tied to the proper shipping method, clear your cart and add the items again to rule out cache issues in the cart.


Nick Hendler

Offline

 

#4 01-15-2018 14:04:00

Cww2
Member
Registered: 08-15-2008
Posts: 119

Re: I am still having shipping issues and can not find the error

Yes, and it is not consistent on any product, I have pulled them all and nothing in common

Offline

 

#5 01-16-2018 09:17:05

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19512
Website

Re: I am still having shipping issues and can not find the error

You've got a $8.00 handling fee set under Store / Component / Settings / Shipping Settings.


Nick Hendler

Offline

 

#6 01-16-2018 13:34:34

Cww2
Member
Registered: 08-15-2008
Posts: 119

Re: I am still having shipping issues and can not find the error

thank you

Offline

 

#7 01-16-2018 13:42:42

Cww2
Member
Registered: 08-15-2008
Posts: 119

Re: I am still having shipping issues and can not find the error

I just looked and do not see it under Store / Component / Settings / Shipping Settings.  Did you change it?

Offline

 

#8 01-16-2018 17:58:04

Cww2
Member
Registered: 08-15-2008
Posts: 119

Re: I am still having shipping issues and can not find the error

Item Subtotal    $57.19
Delivery Total    $76.80
Total    $133.99
Order Number
ORD2018011610
Order Status
Pending Shipment

3rd one in past 24

Offline

 

#9 01-17-2018 03:08:21

zanart
Member
From: bedford
Registered: 04-02-2008
Posts: 1642
Website

Re: I am still having shipping issues and can not find the error

shouldn't it be more like this.
Not sure how you are working canada as you are adding 28.95 to shipping total, but then setting shipping to 28.95 anyway.

Code:

<?php

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

$ship_name  = 'Standard Shipper';
$ship_total = 0;

if         ($info['total'] >= 0 && $info['total'] <= 15)   {$ship_total = 7.95;}
elseif  ($info['total'] >= 15 && $info['total'] <= 30)   {$ship_total = 8.95;}
elseif  ($info['total'] >= 30 && $info['total'] <= 50)   {$ship_total = 9.95;}
elseif  ($info['total'] >= 50 && $info['total'] <= 75)   {$ship_total = 10.95;}
elseif  ($info['total'] >= 75 && $info['total'] <= 100)  {$ship_total = 11.95;}
elseif  ($info['total'] >= 100 && $info['total'] <= 125)  {$ship_total = 12.95;}
elseif  ($info['total'] >= 125 && $info['total'] <= 200)  {$ship_total = 14.95;}
else                             {$ship_total = 16.00;}

$custom = array('Standard Shipper' => $ship_total);

if ($info['country'] == 'Canada') {
     
     $ship_total = $ship_total + 28.95;
     
     $canadian_method = 'For Canadian orders of small items (all items must fit within a video box or regular shipping rates apply) please choose this option (no tracking and no insurance)';
     
     $custom = array($canadian_method => $ship_total);

}


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

?>

Last edited by zanart (01-17-2018 03:08:46)


- Euorpacart 8

Offline

 

#10 01-17-2018 08:18:37

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19512
Website

Re: I am still having shipping issues and can not find the error

@zanart:  That logic is off.  If on one condition you use 'less than or equal to X', in the next line you should use 'greater than X', not 'greater than or equal to X' as that's a condition that matches the previous one partially.  The if-elseif-else condition in post 1 is accurate and would work as intended.


Nick Hendler

Offline

 

#11 01-17-2018 08:27:45

zanart
Member
From: bedford
Registered: 04-02-2008
Posts: 1642
Website

Re: I am still having shipping issues and can not find the error

here's the default(written by you) custom method based on cost

Code:

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

$method = 'Standard Carrier';

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

     $custom = array($method => '2.50');

} elseif ($info['total'] > '9.99' && $info['total'] <= '15.99') {

     $custom = array($method => '3.95');

} elseif ($info['total'] > '15.99' && $info['total'] <= '49.99') {

     $custom = array($method => '5.00');

} else {

     $custom = array($method => '0.00');

} // End of if statement.

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

Looks similar to the logic in my version??

Anyway, is the problem down to $this->globals('ecom.customship_response',$custom);in the original script,
can you use:
$this->globals('ecom.customship_response',array($ship_name => $ship_total, $canadian_method => $canadian_total));


- Euorpacart 8

Offline

 

#12 01-17-2018 11:27:18

Cww2
Member
Registered: 08-15-2008
Posts: 119

Re: I am still having shipping issues and can not find the error

so what do I need to do, this script worked all day long on 7, I am getting shipping errors everyday & losing orders!

Offline

 

#13 01-18-2018 09:30:27

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19512
Website

Re: I am still having shipping issues and can not find the error

zanart wrote:

here's the default(written by you) custom method based on cost

Yours reads on one line less than or equal to X, then on the next greater than or equal to X.

Mine reads on one line less than or equal to X, then on the next greater than X.


Nick Hendler

Offline

 

#14 01-18-2018 09:38:39

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19512
Website

Re: I am still having shipping issues and can not find the error

It's actually $7.95 being added, which leads me to believe that you are rating two different shipping groups.  Check all your items to be sure that all of them have the same shipmethod (custom), custom script (whatever this script is) and same ship from location (country, state, zip).  You are probably seeing two groups of items being rated in checkout and if you duplicated a problem order could probably verify that.


Nick Hendler

Offline

 

Board footer