Jump to content
Sign in to follow this  
jim_d

How can I force quantities to be "1"?

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?

Share this post


Link to post
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 backup before making changes.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×