Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How can I force quantities to be "1"?


jim_d

Recommended Posts

How can I force product quantities to always be one?

 

I’ve tried the Download Controller and the Drop Down Button in Shopping Cart contributions. I’ve also tried a change I found on this forum that prevents users from changing the number in the quantity column of the shopping cart.

 

However, in all cases, if the user “Adds to Cart” a product that’s already in the cart, the quantity gets incremented.

 

I want the quantities to always be “1” since all I have are downloadable documents.

 

Ideally, each product should have it's own attribute that determines the maximum quantity that can be ordered. I don't need that level of sophistication at this time though. For now, I'd be happy if all products are limited to a quantity of one.

 

Am I overlooking something on this forum or a contribution?

Link to comment
Share on other sites

This has nothing to do with order_total modules, but you just need to change the add_to_cart quantity sections in includes/application_top.php from

$cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1

to just 1.

 

Hth,

Matt

Always back up before making changes.

Link to comment
Share on other sites

Thank you. That works great!

 

I had been trying (unsuccessfully) to figure out where (in what file) the increment was taking place. I didn't even look in "application_top.php."

 

That brings me to another question. I gather from other posts in the forum that there is no flowchart for the osCommerce code. But, is there perhaps a description of the function of each file?

 

The only thing that I know about is "tep_database-pr2.2-CVS.pdf," which only gives me insight into database structure, not functionality.

Link to comment
Share on other sites

  • 6 months later...

I tried doing this, but I get the following error.

 

Parse error: parse error, unexpected T_LNUMBER in /mnt/web_i/d25/s09/b01fe479/www/FilmShowcase/nfoscomm/catalog/includes/application_top.php on line 358

What did I do wrong?

 

Thanks in advance.

Link to comment
Share on other sites

Okay, I figured out what I was doing wrong.

 

However, this only stops people from adding more of the same item to their cart if they click the "Add to cart" button in the product description page.

 

If they browse by categories and click the "Buy Now" button or "Add to cart" from the Reviews page, the item still gets added.

 

Where can we modify those two instances?

 

Thanks!

 

-LG

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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...