Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

help with stock ups.php /php codeing


keithschm

Recommended Posts

ok so my goal is to offer free ground shipping and the subtract the ground shipping cost from the other ups options (next day, 2nd day, ETC...)

 

ok so I have the default array of which types of shipping methodes I would like to allow

 

$this->types = array('1DA' => 'Next Day Air',
						   '2DA' => '2nd Day Air',
						   'GND' => ' <font color="red">SOHi Performance offers FREE Ground</font>');

 

then I have changed this to only use the allowed types and also pulled out the ground cost

 for ($i=0; $i<$qsize; $i++) {
	list($type, $cost) = each($upsQuote[$i]);
	if($type == 'GND'){$groundcost = $cost;}		
							if( isset($this->types[$type]) ) {
	$methods[] = array('id' => $type,
	'title' => $this->types[$type],
	'cost' => ($cost + MODULE_SHIPPING_UPS_HANDLING) * $shipping_num_boxes);
	}
	}

 

Then subtracted the ground cost from all costs in the array

 

foreach ($methods as $key => $val){
		$methods[$key]['cost'] -= $groundcost;
	}

 

on checkout shipping.php all prices show correct

 

ground= $0.00

2nd Day air = 2nd day air$- Ground cost

nextday air - nextday air cost - ground cost

 

if I select ground and go to checkout_confirmation.php the ground stays at $0.00 and all is well, but if you select 2nd day or next day it reverts back to their orig quotes.

 

 

anyone have any Idea. I have also set the array myself $methods[1]['cost']= '0' etc.. and the checkout_shipping page shows correct, but the confirmation page does not.

 

HELP

 

Thanks

Link to comment
Share on other sites

  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...