Jump to content
dmGremlin

[contribution] individual product shipping prices

Recommended Posts

I've installed v4.3a & the updated files on v2.2-MS2. I've read the last 8-10 pages and still have questions, so here goes...

......

Example: Item A has a IndivProdShipPrice of $10. Item B has a UPS shipping fee of $6.50.

I would expect my checkout total shipping fee to be $16.50

Instead, I get a checkout shipping total of either $10 or $6.50 depending upon which option I choose.

 

Is it supposed to do this?

If your confirmation page shows 16.50 as shipping total it works. If not you did something wrong somewhere. The only shipping methods to select from are none indiv shipping. That is not an option to select from it is added to end of checkout

Edited by crashwave

q_|_|| _|9~~J >-o>-o q_|_|| )| q_|| )

Share this post


Link to post
Share on other sites
If your confirmation page shows 16.50 as shipping total it works. If not you did something wrong somewhere. The only shipping methods to select from are none indiv shipping. That is not an option to select from it is added to end of checkout

For brevity, I'm shortening 'Individual Product Shipping' to IPS...

My previous test site had a couple of mods, so I did a fresh install of OSC 2.2 MS2 & a fresh install of IPS v4.3a with no other mods - Now it properly adds IPS & UPS shipping fees for the checkout shipping total.

However, I had to disable IPS in admin console (still installed & configured) for the checkout_shipping display to work properly. Is this correct?

 

If IPS is ENABLED in the admin console then I get a menu choice of shipping options (checkout_shipping.php) which includes IPS: If I chose UPS fee, then UPS & IPS are totalled correctly - BUT if I chose IPS fee then only IPS fee is at checkout total - UPS fee is NOT added.

Disabling IPS in admin console seems to side-step this problem.

 

Also noticed: If IPS shipping is set for an item, but the item has weight>0 then this item will change the UPS shipping total. It would be nice to be able to leave the weight.

 

Thanks in advance!

Share this post


Link to post
Share on other sites

However, if IPS is disabled in admin console, then there is no shipping fee AT ALL during checkout if the item(s) in the cart all have IPS shipping prices set. So much for 'side-stepping' my problem this way...

 

This is from a fresh install. I'm assuming that it's not supposed to do this. I'm not sure where to look for my error since I'm not a PHP expert and there are a bunch of modified pages... :( Any tips or ideas?

 

Is the IPS shipping total supposed to show up as a non-selectable item on checkout_shipping.php?

 

I do NOT have the free shipping module installed...

 

-Randy

Edited by Randelia

Share this post


Link to post
Share on other sites

Thanks for help Randelia.

I took plunge and with heart in hand edit the file like so:

 

// Individual Shipping Contrib

$extra_shipping_query = tep_db_query("select products_ship_price, products_ship_price_two from " . TABLE_PRODUCTS_SHIPPING . " where products_id = '" . (int)$products_id . "'");

$extra_shipping = tep_db_fetch_array($extra_shipping_query);

if (($extra_shipping['products_ship_price']) > 0) {

echo '<i>(This item requires shipping of $'. $extra_shipping['products_ship_price'];

if (($extra_shipping['products_ship_price_two']) > 0) {

echo ' for the first item, and $' . $extra_shipping['products_ship_price_two'] . ' for each additional item.)</i>';

} else {

echo ')</i>';

}

 

Now it doesn't look like double chargi g for shipping ,but its dropping last 0 in shipping charge looks like so:

 

(This item requires shipping of $2.5)

 

Any ideals or suggestions on getting it back?

tried different things but none working so far.

Tia

Share this post


Link to post
Share on other sites
If your confirmation page shows 16.50 as shipping total it works. If not you did something wrong somewhere. The only shipping methods to select from are none indiv shipping. That is not an option to select from it is added to end of checkout

Is checkout_shipping.php supposed to show 'Individual Shipping - Zone 1' as a shipping method that you can select when you're checking out? It shows up this way on every test site I've setup - Is this normal?

 

Is there anyway to NOT display 'Individual Shipping' as a shipping option at checkout? If you choose IndivualShipping as an option then any UPS shipping fees are NOT included in the checkout total.

 

If you select any of the UPS shipping options then the checkout shipping total is correct - it adds Individual Shipping fees and the UPS shipping fees together.

 

This list of shipping options appears to be created in the nested $i & $j loops starting around line 300 of checkout_shipping.php. If an exception were written to skip indvship when PHP is generating the HTML for each shipping method it would probably take care of the problem. Any ideas?

Share this post


Link to post
Share on other sites

I tried a hard-coded hack that seems to work for my site since IndividualShipping method correlated to $i=0 & $j=0. I started the loops at 1 instead of 0 - this skips showing IndivSHip as a selectable method.

 

Here's the 2 lines I changed starting around line 300 of checkout_shipping.php:

// for ($i=0, $n=sizeof($quotes); $i<$n; $i++) { //original!
for ($i=1, $n=sizeof($quotes); $i<$n; $i++) {	// skips IndivShip
...
// for ($j=0, $n2=sizeof($quotes[$i]['methods']); $j<$n2; $j++) { //original
for ($j=1, $n2=sizeof($quotes[$i]['methods']); $j<$n2; $j++) { //skips IndivShip

Does this appear dangerous to anyone?

Share this post


Link to post
Share on other sites
Now it doesn't look like double chargi g for shipping ,but its dropping last 0 in shipping charge looks like so:

(This item requires shipping of $2.5)

Any ideals or suggestions on getting it back?

Tia

I'm not real familiar with PHP, but I think this is where the problem lies:

 

You removed:

if($extra_shipping['products_ship_price'] == '0.00'){

 

I'm betting that the =='0.00' is what sets the format of the output (i.e. 2 decimal place)

 

Try changing your line:

if (($extra_shipping['products_ship_price']) > 0) {

To:

if (($extra_shipping['products_ship_price']) >'0.00') {

 

Or maybe add back the lines you removed like this:

if($extra_shipping['products_ship_price'] == '0.00'){

}else{

 

Or maybe:

if($extra_shipping['products_ship_price'] == '0.00'){

echo '';

}else{

Share this post


Link to post
Share on other sites
yes and yes

for 1. you would hae to configure that shipping option to disregard indv shipping prices at the end. I don't know how that module is set up it might already do that but indv shipping is added at the end to the total. You might want to change to if(shipping method pickup selected) subtract $shiptotal.

 

I have no idea how to do that.

Share this post


Link to post
Share on other sites

OH OH NO!!!

After move from catalog to root--I no longer have module as option in admin section.

PLEASE anyone know what might have happened?

Host moved for me.

Just sick over this.

PLEASE!

Everything is still in place database,editing to files?

Individual Shipping Contrib

Share this post


Link to post
Share on other sites

I'm having a problem installing this contrib. I'm getting these errors, I'm not very familiar with PHP and can't figure out what's wrong. I've reinstalled 3 times and it's the same.

 

Parse error: parse error in /home/httpd/vhosts/efurniture-direct.com/httpdocs/catalog/includes/classes/shipping.php on line 51

 

Fatal error: Cannot instantiate non-existent class: shipping in /home/httpd/vhosts/efurniture-direct.com/httpdocs/catalog/checkout_shipping.php on line 64

 

 

I really need this problem to go away any help would be great.

Share this post


Link to post
Share on other sites

Please any suggestions or ideals?

The contribution is setup in db and all my files are edited correctly.

But it is no longer in admin as an option to install and use, after moving to root directory.

Please any suggestions whereI might look?

Share this post


Link to post
Share on other sites

WHEW!!!Got it back,BUT now on checkout_shipping page after test purchase i get this:

MODULE_SHIPPING_INDVSHIP_TEXT_TITLE

Any suggestions or ideals?

Last thing before going Live, if I got enough sense to work camera now.;)

Share this post


Link to post
Share on other sites

OK sorry about that.

I redone indvship.php in both places now right as rain!

Thanks to all that have to bear with me.

Talking about learning curve.

Believe I can install oscommerce in my sleep ;)

4 months and finally finished for a llittle bit.

Next up PWA module after a couple days rest ;)

But this is going to be the most useful module I am going to use.

BIG Thank You for contributors for this Module.

Share this post


Link to post
Share on other sites

Hi all,

 

First off, great mod... seems to do what I require. Quick question though :

 

I want to specify the IPS option for most of my products which I have done, but only have this price and option apply to items shipped within one zone (uk mainland). For items shipped off shore ie northern ireland, ireland, channel islands etc I don't want the IPS module to show, but rather show the standard osC "zones" shipping method so they're quoted based on weight. Does anyone know how to do this?

Share this post


Link to post
Share on other sites
Hi all,

 

First off, great mod... seems to do what I require. Quick question though :

 

I want to specify the IPS option for most of my products which I have done, but only have this price and option apply to items shipped within one zone (uk mainland). For items shipped off shore ie northern ireland, ireland, channel islands etc I don't want the IPS module to show, but rather show the standard osC "zones" shipping method so they're quoted based on weight. Does anyone know how to do this?

 

Hello,

 

OK, it would seem that I just need to select the relevant shipping zone in the confi for this shipping method. The thing is, there's no zone to select? Where should I be defining these zones? Or do I have some code missing somewhere?

 

TIA

Share this post


Link to post
Share on other sites

Hi everyone - thanks for this great mod and the support behind it!

 

I have installed 4.3a and while I don't get any php errors, I can't seem to get my values to set in the admin section, nor does the IPSP option appear in the shipping modules area. I do get two options in the config>shipping, though.

 

What happens when I get to the product edit page is that I get something that looks like this:

 

TEXT_PRODUCTS_ZIPCODE [input box] null

Indv. Shipping Price:[input box] null

Each Additional Price:[input box] null

 

 

So when I try to add IPS to a product , the values never take.

 

Can anyone help me out? Any ideas where to start looking for code tweaks?

 

Thanks so much!

Mike

Share this post


Link to post
Share on other sites
Hello,

 

OK, it would seem that I just need to select the relevant shipping zone in the confi for this shipping method. The thing is, there's no zone to select? Where should I be defining these zones? Or do I have some code missing somewhere?

 

TIA

 

Sorted it. I didn't realise the shipping zones you select on the config were defined by the tax zones you set up under "zones" and "tax zones".

Share this post


Link to post
Share on other sites

Hello All,

 

I'm trying to get this module working with the new Multi Vendor Shipping module, has anyone been successful in this? I've got it working except one piece of code integration which I can't just get my head around.

 

My post regarding the code can be found below, if anyone can tell me how to go about it it would be most appreicated.

 

http://forums.oscommerce.com/index.php?sho...=101973&st=980#

 

TIA

 

Sam

Share this post


Link to post
Share on other sites

Hi,

 

This looks like a great contribution. I just wanted to ask a few questions about it before I go ahead and install it on one of my websites.

 

1) Is the contribution is full working order? Are there any serious bugs that stop it from functioning correctly?

 

2) Can I still apply other shipping options to products?

 

3) Is there a way to add the shipping costs on a per product basis through a system like easypopulate?

 

If anyone can help with the above it would be much appreciated.

 

thanks!

Share this post


Link to post
Share on other sites

Guys I followed all of the instructions and ended up with this error, can anybody please help?

Fatal error: Call to undefined method shipping::get_shiptotal() in includes\classes\shipping.php on line 22

Share this post


Link to post
Share on other sites
Hi everyone - thanks for this great mod and the support behind it!

 

I have installed 4.3a and while I don't get any php errors, I can't seem to get my values to set in the admin section, nor does the IPSP option appear in the shipping modules area. I do get two options in the config>shipping, though.

 

What happens when I get to the product edit page is that I get something that looks like this:

 

TEXT_PRODUCTS_ZIPCODE [input box] null

Indv. Shipping Price:[input box] null

Each Additional Price:[input box] null

So when I try to add IPS to a product , the values never take.

 

Can anyone help me out? Any ideas where to start looking for code tweaks?

 

Thanks so much!

Mike

 

I just installed this and had the same issue. I looked in the Module Admin and turned off the shipping zone, and the shipping price showed up. I hope this helps, but let me know if you need more specifics.

Share this post


Link to post
Share on other sites

Fatal error: Call to undefined method shipping::get_shiptotal() in D:\www\includes\classes\shipping.php on line 21 here is my error can anybody help? here is also my code for shipping.php

 

<?php

/*

$Id: shipping.php,v 1.23 2003/06/29 11:22:05 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

class shipping {

var $modules;

 

// class constructor

function shipping($module = '') {

global $language, $PHP_SELF, $cart;

// BOF: Indv Shipping Prices//phpmom.com

$products = $cart->get_products();

$shiptotal = $this->get_shiptotal();

$indvcount = $this->get_indvcount();

// EOF: Indv Shipping Prices

 

 

 

if (defined('MODULE_SHIPPING_INSTALLED') && tep_not_null(MODULE_SHIPPING_INSTALLED)) {

$this->modules = explode(';', MODULE_SHIPPING_INSTALLED);

 

$include_modules = array();

 

if ( (tep_not_null($module)) && (in_array(substr($module['id'], 0, strpos($module['id'], '_')) . '.' . substr($PHP_SELF, (strrpos($PHP_SELF, '.')+1)), $this->modules)) ) {

$include_modules[] = array('class' => substr($module['id'], 0, strpos($module['id'], '_')), 'file' => substr($module['id'], 0, strpos($module['id'], '_')) . '.' . substr($PHP_SELF, (strrpos($PHP_SELF, '.')+1)));

} else {

reset($this->modules);

while (list(, $value) = each($this->modules)) {

$class = substr($value, 0, strrpos($value, '.'));

$include_modules[] = array('class' => $class, 'file' => $value);

}

}

 

for ($i=0, $n=sizeof($include_modules); $i<$n; $i++) {

include(DIR_WS_LANGUAGES . $language . '/modules/shipping/' . $include_modules[$i]['file']);

include(DIR_WS_MODULES . 'shipping/' . $include_modules[$i]['file']);

 

$GLOBALS[$include_modules[$i]['class']] = new $include_modules[$i]['class'];

}

}

}

 

function quote($method = '', $module = '') {

global $total_weight, $shipping_weight, $shipping_quoted, $shipping_num_boxes;

 

$quotes_array = array();

 

if (is_array($this->modules)) {

$shipping_quoted = '';

$shipping_num_boxes = 1;

$shipping_weight = $total_weight;

 

if (SHIPPING_BOX_WEIGHT >= $shipping_weight*SHIPPING_BOX_PADDING/100) {

$shipping_weight = $shipping_weight+SHIPPING_BOX_WEIGHT;

} else {

$shipping_weight = $shipping_weight + ($shipping_weight*SHIPPING_BOX_PADDING/100);

}

 

if ($shipping_weight > SHIPPING_MAX_WEIGHT) { // Split into many boxes

$shipping_num_boxes = ceil($shipping_weight/SHIPPING_MAX_WEIGHT);

$shipping_weight = $shipping_weight/$shipping_num_boxes;

}

 

$include_quotes = array();

 

reset($this->modules);

while (list(, $value) = each($this->modules)) {

$class = substr($value, 0, strrpos($value, '.'));

if (tep_not_null($module)) {

if ( ($module == $class) && ($GLOBALS[$class]->enabled) ) {

$include_quotes[] = $class;

}

} elseif ($GLOBALS[$class]->enabled) {

$include_quotes[] = $class;

}

}

 

$size = sizeof($include_quotes);

for ($i=0; $i<$size; $i++) {

$quotes = $GLOBALS[$include_quotes[$i]]->quote($method);

if (is_array($quotes)) $quotes_array[] = $quotes;

}

}

 

return $quotes_array;

}

 

function cheapest() {

if (is_array($this->modules)) {

$rates = array();

 

reset($this->modules);

while (list(, $value) = each($this->modules)) {

$class = substr($value, 0, strrpos($value, '.'));

if ($GLOBALS[$class]->enabled) {

$quotes = $GLOBALS[$class]->quotes;

for ($i=0, $n=sizeof($quotes['methods']); $i<$n; $i++) {

if (isset($quotes['methods'][$i]['cost']) && tep_not_null($quotes['methods'][$i]['cost'])) {

$rates[] = array('id' => $quotes['id'] . '_' . $quotes['methods'][$i]['id'],

'title' => $quotes['module'] . ' (' . $quotes['methods'][$i]['title'] . ')',

'cost' => $quotes['methods'][$i]['cost']);

}

}

}

}

 

$cheapest = false;

for ($i=0, $n=sizeof($rates); $i<$n; $i++) {

if (is_array($cheapest)) {

if ($rates[$i]['cost'] < $cheapest['cost']) {

$cheapest = $rates[$i];

}

} else {

$cheapest = $rates[$i];

}

}

 

return $cheapest;

}

}

}

?>

Share this post


Link to post
Share on other sites

I'm getting the following error in my classes/shipping.php

 

Fatal error: Call to undefined function: tep_get_configuration_key_value() in /home/fifthave/public_html/includes/classes/shipping.php on line 39

 

 

Here is my code:

<?php

/*

$Id: shipping.php,v 1.23 2003/06/29 11:22:05 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

class shipping {

var $modules;

 

// class constructor

function shipping($module = '') {

global $language, $PHP_SELF, $cart;

// BOF: Indv Shipping Prices//phpmom.com

$products = $cart->get_products();

 

$shiptotal = $this->get_shiptotal();

$indvcount = $this->get_indvcount();

// EOF: Indv Shipping Prices

 

if (defined('MODULE_SHIPPING_INSTALLED') && tep_not_null(MODULE_SHIPPING_INSTALLED)) {

$this->modules = explode(';', MODULE_SHIPPING_INSTALLED);

 

$include_modules = array();

 

if ( (tep_not_null($module)) && (in_array(substr($module['id'], 0, strpos($module['id'], '_')) . '.' . substr($PHP_SELF, (strrpos($PHP_SELF, '.')+1)), $this->modules)) ) {

$include_modules[] = array('class' => substr($module['id'], 0, strpos($module['id'], '_')), 'file' => substr($module['id'], 0, strpos($module['id'], '_')) . '.' . substr($PHP_SELF, (strrpos($PHP_SELF, '.')+1)));

} else {

reset($this->modules);

// BOF: PhpMom's Indv Shipping Prices

// Show either normal shipping modules or Individual shipping module when Individual Shipping Module is On

// Show Individual Shipping Only

if($indvcount==sizeof($products)){ //hadir

if ((tep_get_configuration_key_value('MODULE_SHIPPING_INDVSHIP_STATUS')) && ((tep_not_null($shiptotal)) || $shiptotal == 0)) {

$include_modules[] = array('class'=> 'indvship', 'file' => 'indvship.php');

}}

//START COMMENT IF YOU DO NOT HAVE FREE SHIPPING MODULE

// BOF: WebMakers.com Added: Downloads Controller - Free Shipping and Payments

// Show either normal shipping modules or free shipping module when Free Shipping Module is On

// Free Shipping Only

elseif ((tep_get_configuration_key_value('MODULE_SHIPPING_FREESHIPPER_STATUS')) && $cart->show_weight()==0 && ($shiptotal == '0' || !$shiptotal)) {

$include_modules[] = array('class'=> 'freeshipper', 'file' => 'freeshipper.php');

 

//END COMMENT IF YOU DO NOT HAVE FREE SHIPPING MODULE

// All Other Shipping Modules

//} else { if(sizeof($products)>$indvcount){

//while (list(, $value) = each($this->modules)) { //try foreach is faster//hadir

// $class = substr($value, 0, strrpos($value, '.'));

// Don't show Free Shipping Module

// if (($class !='freeshipper')/* && ($class != 'indvship')*/) {

// $include_modules[] = array('class' => $class, 'file' => $value);

}

// }

// }

//}//COMMENT IF YOU DO NOT HAVE FREE SHIPPING MODULE and you commented above

 

// EOF: Free Shipping and Payments// EOF: Indv Shipping Prices

}

 

 

for ($i=0, $n=sizeof($include_modules); $i<$n; $i++) {

include(DIR_WS_LANGUAGES . $language . '/modules/shipping/' . $include_modules[$i]['file']);

include(DIR_WS_MODULES . 'shipping/' . $include_modules[$i]['file']);

 

$GLOBALS[$include_modules[$i]['class']] = new $include_modules[$i]['class'];

}

}

}

 

function quote($method = '', $module = '') {

global $total_weight, $shipping_weight, $shipping_quoted, $shipping_num_boxes;

 

$quotes_array = array();

 

if (is_array($this->modules)) {

$shipping_quoted = '';

$shipping_num_boxes = 1;

$shipping_weight = $total_weight;

 

if (SHIPPING_BOX_WEIGHT >= $shipping_weight*SHIPPING_BOX_PADDING/100) {

$shipping_weight = $shipping_weight+SHIPPING_BOX_WEIGHT;

} else {

$shipping_weight = $shipping_weight + ($shipping_weight*SHIPPING_BOX_PADDING/100);

}

 

if ($shipping_weight > SHIPPING_MAX_WEIGHT) { // Split into many boxes

$shipping_num_boxes = ceil($shipping_weight/SHIPPING_MAX_WEIGHT);

$shipping_weight = $shipping_weight/$shipping_num_boxes;

}

 

$include_quotes = array();

 

reset($this->modules);

while (list(, $value) = each($this->modules)) {

$class = substr($value, 0, strrpos($value, '.'));

if (tep_not_null($module)) {

if ( ($module == $class) && ($GLOBALS[$class]->enabled) ) {

$include_quotes[] = $class;

}

} elseif ($GLOBALS[$class]->enabled) {

$include_quotes[] = $class;

}

}

 

$size = sizeof($include_quotes);

for ($i=0; $i<$size; $i++) {

$quotes = $GLOBALS[$include_quotes[$i]]->quote($method);

if (is_array($quotes)) $quotes_array[] = $quotes;

}

}

 

return $quotes_array;

}

//BOF Indv shipping modifications//Hadir@phpmom

function get_shiptotal() {

global $cart, $order;

$this->shiptotal = '';

$products = $cart->get_products();

for ($i=0, $n=sizeof($products); $i<$n; $i++) {

// mod indvship//modified hadir

if (tep_not_null($products[$i]['products_ship_price'])) {

$products_ship_price = $products[$i]['products_ship_price'];

$products_ship_price_two = $products[$i]['products_ship_price_two'];

$products_ship_zip = $products[$i]['products_ship_zip'];

$qty = $products[$i]['quantity'];

if(tep_not_null($products_ship_price) ||tep_not_null($products_ship_price_two)){

$this->shiptotal += ($products_ship_price);

if ($qty > 1) {

if (tep_not_null($products_ship_price_two)) {

$this->shiptotal += ($products_ship_price_two * ($qty-1));

} else {

$this->shiptotal += ($products_ship_price * ($qty-1));

}

}/////////////NOT HERE <<------------

}

}

}// CHECK TO SEE IF SHIPPING TO HOME COUNTRY, IF NOT INCREASE SHIPPING COSTS BY AMOUNT SET IN ADMIN/////////////move back here <<------------

if (($order->delivery['country']['id']) != INDIVIDUAL_SHIP_HOME_COUNTRY) {

if(INDIVIDUAL_SHIP_INCREASE > '0' || $this->shiptotal > '0')

$this->shiptotal *= INDIVIDUAL_SHIP_INCREASE;

else $this->shiptotal += INDIVIDUAL_SHIP_INCREASE * $this->get_indvcount();

}

return $this->shiptotal;

}

 

function get_indvcount() {

global $cart;

$this->indvcount = '';

$products = $cart->get_products();

for ($i=0, $n=sizeof($products); $i<$n; $i++) {

// mod indvship//modified hadir

if (tep_not_null($products[$i]['products_ship_price'])) {

$products_ship_price = $products[$i]['products_ship_price'];//}

$products_ship_price_two = $products[$i]['products_ship_price_two'];

if(is_numeric($products_ship_price)){

$this->indvcount += '1';

}

} } return $this->indvcount;

}

 

//EOF Indv shipping mod//Hadir@phpmom

 

function cheapest() {

if (is_array($this->modules)) {

$rates = array();

 

reset($this->modules);

while (list(, $value) = each($this->modules)) {

$class = substr($value, 0, strrpos($value, '.'));

if ($GLOBALS[$class]->enabled) {

$quotes = $GLOBALS[$class]->quotes;

for ($i=0, $n=sizeof($quotes['methods']); $i<$n; $i++) {

if (isset($quotes['methods'][$i]['cost']) && tep_not_null($quotes['methods'][$i]['cost'])) {

$rates[] = array('id' => $quotes['id'] . '_' . $quotes['methods'][$i]['id'],

'title' => $quotes['module'] . ' (' . $quotes['methods'][$i]['title'] . ')',

'cost' => $quotes['methods'][$i]['cost']);

}

}

}

}

 

$cheapest = false;

for ($i=0, $n=sizeof($rates); $i<$n; $i++) {

if (is_array($cheapest)) {

if ($rates[$i]['cost'] < $cheapest['cost']) {

$cheapest = $rates[$i];

}

} else {

$cheapest = $rates[$i];

}

}

 

return $cheapest;

}

}

}

?>

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×