iperez_genius Posted January 16, 2007 Posted January 16, 2007 this is going to be a really easy question to solve for some people. There is a get_quantity function already in OScommerce function get_quantity($products_id) { if ($this->contents[$products_id]) { return $this->contents[$products_id]['qty']; } else { return 0; } } if need a SET function can anyone help out here Ilan
iperez_genius Posted January 16, 2007 Author Posted January 16, 2007 this is what i have so far function deduct_quantity($products_id) { $this->contents[$products_id] = array('qty' => $qty-1); } and the call to this function is made in the application_top.php $cart->deduct_quantity($HTTP_POST_VARS['products_id'][$i]); so firstly i hope my function is correct and secondly i receive the following error when i try to run the function Fatal error: Call to undefined method shoppingCart::deduct_quantity() in includes/.../application_top.php on line 531 Ilan
Guest Posted January 17, 2007 Posted January 17, 2007 your function has to be a member function of the cart class in the shopping_cart.php file. As of the set quantity it is done with the add_cart member function of the cart class. Look in the same file.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.