hayesb2 Posted February 8, 2005 Share Posted February 8, 2005 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 More sharing options...
bobg7 Posted February 8, 2005 Share Posted February 8, 2005 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 More sharing options...
hayesb2 Posted February 8, 2005 Author Share Posted February 8, 2005 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. <{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
hayesb2 Posted February 8, 2005 Author Share Posted February 8, 2005 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 More sharing options...
xtreeq Posted September 24, 2006 Share Posted September 24, 2006 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 More sharing options...
ilfriz80 Posted February 26, 2007 Share Posted February 26, 2007 :thumbsup: thank you hayesb2 Link to comment Share on other sites More sharing options...
davidsin Posted August 15, 2007 Share Posted August 15, 2007 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 More sharing options...
billba Posted August 25, 2007 Share Posted August 25, 2007 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 More sharing options...
♥Monika in Germany Posted August 25, 2007 Share Posted August 25, 2007 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 More sharing options...
Nullachtfuffzehn Posted August 25, 2007 Share Posted August 25, 2007 I'm with Monika. The upper examples may work, but they are pretty unsecure. In addition, you can, if you know OSC a bit, just enter the certain parameters to the URI and the functionality is still there. Link to comment Share on other sites More sharing options...
annispanties Posted September 26, 2007 Share Posted September 26, 2007 Can someone detail how to lock the quantity at one and remove the quantity box, but leave a display? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.