Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Remove Quantity Option from shopping_cart.php


hayesb2

Recommended Posts

I do not want customers to have the ability to change the quantity on the shopping_cart.php page. How do I get rid of this?

I have searched the forums, and played in the admin control and cannot figure this out...it seems like it would be an easy fix...

Link to comment
Share on other sites

In shopping_cart.php at around line 67 find and remove:

 

$info_box_contents[0][] = array('align' => 'center',
                                   'params' => 'class="productListing-heading"',
                                   'text' => TABLE_HEADING_QUANTITY);

 

And at around line 139 (after removing above) find and remove:

 

 $info_box_contents[$cur_row][] = array('align' => 'center',
                                            'params' => 'class="productListing-data" valign="top"',
                                            'text' => tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4"') . tep_draw_hidden_field('products_id[]', $products[$i]['id']));

That will remove the Quantity Dropdown for you.

 

Remember, BACKUP BEFORE MAKING ANY CHANGES. Sorry to yell that, but it is important and the most forgotten.

 

Bob G.

Installed Contributions: CCGV, Close Popup, Dynamic Meta Tags, Easy Populate, Froogle Data Feeder, Google Position, Infobox Header Entire Row, Live Support for OSC, PayPal Seal with CC images, Report_m Sales, Shop by Price Revised, SQL Updater, Who's Online Enhancement, Footer, GNA EP Assistant and still going.

Link to comment
Share on other sites

Worked like a charm. Thanks!

 

 

 

In shopping_cart.php at around line 67 find and remove:

 

   

$info_box_contents[0][] = array('align' => 'center',
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?'params' => 'class="productListing-heading"',
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?'text' => TABLE_HEADING_QUANTITY);

 

And at around line 139 (after removing above) find and remove:

 

   

 $info_box_contents[$cur_row][] = array('align' => 'center',
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'params' => 'class="productListing-data" valign="top"',
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'text' => tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4"') . tep_draw_hidden_field('products_id[]', $products[$i]['id']));

That will remove the Quantity Dropdown for you.

 

Remember, BACKUP BEFORE MAKING ANY CHANGES. Sorry to yell that, but it is important and the most forgotten.

 

Bob G.

Link to comment
Share on other sites

UPDATE -

 

When I make the code changes as shown above, the quantity option disapears...so far so good...BUT I can no longer Remove Items from the shopping cart.

Obviously this isnt good...How can I fix this so the Qty isnt available without breaking the Remove Items option?

Link to comment
Share on other sites

  • 1 year later...

Since I had the same problem I thought it would be good to post the solution:

at about line 127 remove from the following code:

 

$info_box_contents[$cur_row][] = array('align' => 'center',

'params' => 'class="productListing-data" valign="top"',

'text' => tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4"') . tep_draw_hidden_field('products_id[]', $products[$i]['id']));

 

the phrase:

tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4"') .

 

This will allow the cart to act as ussual but the QTY won't be visible for the user to change it. The remove function will work as ussual.

Link to comment
Share on other sites

  • 5 months later...
  • 5 months later...
Since I had the same problem I thought it would be good to post the solution:

at about line 127 remove from the following code:

 

$info_box_contents[$cur_row][] = array('align' => 'center',

'params' => 'class="productListing-data" valign="top"',

'text' => tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4"') . tep_draw_hidden_field('products_id[]', $products[$i]['id']));

 

the phrase:

tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4"') .

 

This will allow the cart to act as ussual but the QTY won't be visible for the user to change it. The remove function will work as ussual.

 

Thanks for this tip. I've modified my file and it seems to be working fine.

Link to comment
Share on other sites

  • 2 weeks later...

That's all great but what if I want the quantity box to disappear from certain product types (e.g. downloads) but to work as normal for physical items?

 

Having the quantity locked at 1 for downloads would be just as good.

 

TIA

 

billba

Link to comment
Share on other sites

you'll need to define your groups and create a function that checks whether the items should have the quantity box or instead just the quantity display (I was not so fond of the above examples where quantity did not show at all).

 

As you probably know, right now, you can add countless items of the same just by going back to the product page and clicking add to cart repeatedly. If you want to stop that also, you need to hack the add to cart functions also, in fact locking at 1.

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

  • 1 month later...

Archived

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

×
×
  • Create New...