mushindo Posted July 11, 2003 Share Posted July 11, 2003 I have a client who requested that we add a quantity input field into the category page. So in example, if a customer clicks into a category and wants to quickly add say quantity of 50 then click the "buy it now" button, it will automatically add it into the cart. Can anyone help with this? I didnt run across any contributions for this. Thanks in advance! :P Sincerely, Bruce 19 contributions submitted Link to comment Share on other sites More sharing options...
Rumble Posted July 11, 2003 Share Posted July 11, 2003 Hi, Please remember to back up before you try!!!!!! In catalog/includes/modules/product_listing.php files about line 147 locate the following lines; case 'PRODUCT_LIST_BUY_NOW': $lc_align = 'center'; $lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', TEXT_BUY . $listing['products_name'] . TEXT_NOW) . '</a> '; break; ......and change to..... case 'PRODUCT_LIST_BUY_NOW': $lc_align = 'center'; $lc_text = tep_draw_form('cart_quantity', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=add_product')) . '<input type="text" name="quantity" value="1" maxlength="2" size="2"> ' . tep_draw_hidden_field('products_id', $listing['products_id']) . tep_image_submit('button_buy_now.gif', TEXT_BUY . $listing['products_name'] . TEXT_NOW) . '</form>'; break; This should give you a quantity box next to your buy now button in product listing pages (ps. make sure you've activated Buy Now button in product listings in the admin panel) Now when u change the quantity value for and click buy now that quantity of the product will be added to your cart! Hope it works for ya i tried it with 2.2MS1 and worked fine! Any problems let me know. There is also a more complicated contrubution with other functions available at http://www.oscommerce.com/community/contributions,1098 which you might also be interested in. Reddy to Rumble Thank you osCommerce and all who Contribute to her! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.