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 06-05-2014 19:00:45

JDLS88
Member
From: Maryland, USA
Registered: 07-06-2011
Posts: 102
Website

What am I doing wrong with this shipping script?

I took the default script thats based on subtotal and based my own on it. It doesn't seem to be working though and instead returns what I think is the default "Standard Shipping - $10" option at checkout. Any ideas?

Code:

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

$method = 'Standard Carrier 2';


if($info['total'] >= '0' && $info['total']) <= '20'){
     $custship = '7.00';
     $custom = array($method => $custship);
}
elseif($info['total'] >= '20.01' && $info['total'] <= '29.99'){
     $custship = $info['total'] * 0.1;
     $custom = array($method => $custship);
}
elseif($info['total'] >= '30' && $info['total'] <= '39.99'){
     $custship = $info['total'] * 0.2;
     $custom = array($method => $custship);
}
elseif($info['total'] >= '40'){
     $custship = $info['total'] * 0.4;
     $custom = array($method => $custship);
}

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

Jeremy D.

Offline

 

#2 06-06-2014 03:09:30

zanart
Member
From: bedford
Registered: 04-02-2008
Posts: 1706

Re: What am I doing wrong with this shipping script?

Code:

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

$method = 'Standard Carrier 2';


if (($info['total'] >= '0') && ($info['total'] <= '20')){
     $custship = '7.00';
     $custom = array($method => $custship);
}
elseif (($info['total'] >= '20.01') && ($info['total'] <= '29.99')){
     $custship = $info['total'] * 0.1;
     $custom = array($method => $custship);
}
elseif (($info['total'] >= '30') && ($info['total'] <= '39.99')){
     $custship = $info['total'] * 0.2;
     $custom = array($method => $custship);
}
elseif ($info['total'] >= '40'){
     $custship = $info['total'] * 0.4;
     $custom = array($method => $custship);
}

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

?>

Rob

Offline

 

Board footer