Zen Cart Logo
Forums / General Questions / modifying shipping w/ observer

modifying shipping w/ observer

Locked

Views: 1,165

Results 1 to 1 of 1
This thread is locked. New replies are disabled.
2 Nov 2006, 7:35 PM
#1
magichat avatar

magichat

New Zenner

Join Date:
Sep 2006
Posts:
3
Plugin Contributions:
0

modifying shipping w/ observer

I need to modify shipping prices for a particular product, while maintaining my weight table for all other products.

I've got the following observer working, but I'm a bit at a loss as to what I should be doing in the update function. Is there a way to direct the app to a second rate table for this product? Or should I just modify the shipping cost variables directly? And what is that variable's name?

class customShipping extends base {

var $customShippingID = 37;
function customShipping() {
$_SESSION['cart']->attach($this, array('NOTIFIER_CART_ADD_CART_END', 'NOTIFIER_CART_REMOVE_END'));

}

function update(&$class, $eventID) {

if ($_SESSION['cart']->in_cart($this->customShippingID)) {
  $myquan=$_SESSION['cart']->contents[$this->customShippingID]['qty'] ;
  $shipping = 5*$myquan ;
}

}
}