Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

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

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...