Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to put a maximum of items in the shopping cart


smalto

Recommended Posts

Posted

Hello there,

 

I am facing a problem and can't find a solution. :blink:

 

I can only send 6 items per pack at the post and so I would like to set a maximum of items in the shopping cart to 6.

This means that if the client tries to put more total items (not per product) he will be informed that the maximum of items in the cart has been reached and he is not able to put more.

 

If anyone has a solution....

 

Thanks a lot

 

smalto

oscommerce 2.2 ms1 with contrib - lilibikini.com - 2005

Posted

have you tried to look for module or simply lazy and didn't bothered?

 

http://addons.oscommerce.com/info/4155

Please read this line: Do you want to find all the answers to your questions? click here. As for contribution database it's located here!

8 people out of 10 don't bother to read installation manuals. I can recommend: if you can't read the installation manual, don't bother to install any contribution yourself.

Before installing contribution or editing/updating/deleting any files, do the full backup, it will save to you & everyone here on the forum time to fix your issues.

Any issues with oscommerce, I am here to help you.

Posted

Thank you for having replied. Yes I have been through all the possibilities of the contribution and specially this one. It allows to specifiy a maximum of products for each product and not a maximum of product for the shopping cart. So this mod allows to put a maximum of 1 or 2 or 3 items per products but in your shopping cart you can have 20 products.

 

If I am wrong, please tell me. I have searched over the net in forum in english, german and french. Can maybe someone help me in this matter ?

 

Thanks,

 

smalto

oscommerce 2.2 ms1 with contrib - lilibikini.com - 2005

Posted

The configuration table in the database includes item Product Quantities in Shopping Cart with a default maximum count of 99. You could try changing that to 6, if what you want to do is limit the quantity of each product to 6. I don't think it will limit the total number of products in the cart, if that's what you're looking for. That would require some new code modifications, unless there's already an add-on for it that I missed. The code would have to check the total product quantity count after each shopping cart update (includes/classes/shopping_cart.php, most likely) and reject or reduce a change quantity if it causes the grand total to exceed 6, with a message explaining why. In short, it can be done, but will require a new add-on or custom code.

Posted

After a quick lunch and some more thought, I have to ask, "Why would you want to do this?" By refusing to sell more than 6 items in one order, I would think you're severely limiting your sales and income. That's probably why such a limit is not built into osC, or already offered as an add-on. I don't know what you're selling, but have you considered setting your shipping fees such that you can either

 

1) ship by an alternate method (delivery service: UPS, FedEx, DHL, etc.) instead of the Post Office

2) ship multiple packages (max 6 items each)

 

I would look around for ways to charge different shipping based on the total order size, rather than limiting the number of purchases.

Posted

Hello,

 

Thank you for having answered. We have on our website the possibility (fashion jewelery)for each client to return what they have chosen. And we don't want to have people that order 12 or 16 models to return 10 or 14 models. If it is limited to 6 or 7 then they have to choose before and not after. By the way we offer the delivery to our customers and this will also reduce the cost. And finally they can choose to pay by invoice and this will reduce the risk of nonpayments.

 

smalto

oscommerce 2.2 ms1 with contrib - lilibikini.com - 2005

  • 7 months later...
Posted

Hello,

 

Thank you for having answered. We have on our website the possibility (fashion jewelery)for each client to return what they have chosen. And we don't want to have people that order 12 or 16 models to return 10 or 14 models. If it is limited to 6 or 7 then they have to choose before and not after. By the way we offer the delivery to our customers and this will also reduce the cost. And finally they can choose to pay by invoice and this will reduce the risk of nonpayments.

 

smalto

 

For anybody looking for the solution to this, start by changing in application top

 

// performed by the 'buy now' button in product listings and review page
     case 'buy_now' :        if (isset($HTTP_GET_VARS['products_id'])) {
                               if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) {
                                 tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']));
                               } else {
                                 $cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+1);
                               }
                             }
		      tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));

 

to:

 

// performed by the 'buy now' button in product listings and review page
     case 'buy_now' :        if ($cart->count_contents() < 6) {
							if (isset($HTTP_GET_VARS['products_id'])) {
                               if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) {
                                 tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']));
                               } else {
                                 $cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+1);
                               }
                             }
						  }
                             tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));

 

You need to add error messages etc.

osCommerce user since 2003! :thumbsup:

Posted

We have on our website the possibility (fashion jewelery)for each client to return what they have chosen. And we don't want to have people that order 12 or 16 models to return 10 or 14 models. If it is limited to 6 or 7 then they have to choose before and not after.

So the problem is that customers buy the whole store, see what they like, and return the rest? Perhaps you should have stricter return policies. Maybe charge a restocking fee? Doing something to discourage returns by abusive customers might be a better choice (but you know your industry and clientele better than I do...). On the other hand, if this is standard practice throughout your industry, you might have a hard time bucking tradition. You might also consider having larger (and more) images of products, and maybe mini-movies, to help customers get a better feel for what they're buying.

 

frankl's code change is a possibility, but be sure the customer knows why they can't add that 7th product to the cart. If it simply fails to add the product, after several tries the customer will give up and abandon your store. At least give a message explaining why they can't add another product.

Archived

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

×
×
  • Create New...