andresull Posted February 11, 2008 Posted February 11, 2008 I would like to use this contribution "Max total amount for cart" http://addons.oscommerce.com/info/3755 but I'm not sure how to update it to fit v2.2 RC 1 or 2. Thanks in advance, Andres Ullmann (Argentina) Installation instruction for Max Amount in Cart add-On 1) in catalog/shopping_cart.php before: if ($cart->count_contents() > 0) { add: <?php if ($messageStack->size('shopping_cart') > 0) { ?> <tr> <td><?php echo $messageStack->output('shopping_cart'); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } -------------------------- 2) in catalog/includes/languages/[lang]/shopping_cart.php (where [lang] defines your language definition) add: define('TOTAL_AMMOUNT_IN_CART_ERROR', 'You have reached the maximum amount athorised by the shop owner. Please contact us for greater orders.'); -------------------------- 3) in catalog/includes/classes/shopping_cart.php Afer: function add_cart($products_id, $qty = '1', $attributes = '', $notify = true) { global $new_products_id_in_cart, $customer_id; $products_id_string = tep_get_uprid($products_id, $attributes); $products_id = tep_get_prid($products_id_string); add: // Max Amount in Cart $this->calculate(); if ($this->total < MAX_TOTAL_IN_CART || $quantity < $this->get_quantity($products_id)) { at the end of function (before last "}"), add: //Max Amount in Cart } --------------------------- 4) And do the same for function update_quantity(). --------------------------- 5) In Database, add folowing line: INSERT INTO `configuration` ( `configuration_id` , `configuration_title` , `configuration_key` , `configuration_value` , `configuration_description` , `configuration_group_id` , `sort_order` , `last_modified` , `date_added` , `use_function` , `set_function` ) VALUES ( '', 'Maximum Total Price in Cart', 'MAX_TOTAL_IN_CART', '10000', 'Define the max total price in cart. If reached, it will display an error', '3', '19', NULL , '0000-00-00 00:00:00', NULL , NULL ); In case of problem, please contact me. [email protected] GHWEB Informatique Gaëtan Hermann Quote
bigjat69 Posted February 11, 2008 Posted February 11, 2008 the contribution states it is based on new Release (osCommerce 2.2 Milestone 2 051112 Update Released) http://addons.oscommerce.com/info/3755 so why do you need to update it to fit v2.2 RC 1 or 2 ? am i misunderstanding your question? regards web-junkies Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.