EternalOne Posted November 25, 2003 Posted November 25, 2003 is there a contribution or way to put an "add quantity" column in the product listing pages. like something so customers can type in for more than one of the same item. its already on the shopping cart page, but i wanted something thats always on the product listing pages. i've tried looking through the forums but i always get results that have nothing to do with what im looking for.
Guest Posted November 25, 2003 Posted November 25, 2003 Search for the contributions "easy way add Qty box" and/or "Add Multiple Products"...should point you in the right direction -J
Guest Posted November 25, 2003 Posted November 25, 2003 http://www.oscommerce.com/forums/index.php?showtopic=64186
themutantchair Posted November 25, 2003 Posted November 25, 2003 Thanks, I was looking for the same thing; that link really helped. Now, does anybody know how I would add that next to the "buy now" column in the index.php listing of products? This would help a ton.
EternalOne Posted November 25, 2003 Author Posted November 25, 2003 so i guess there's no way to do this on the "product listing" page, not just the "product info" page?
Guest Posted November 26, 2003 Posted November 26, 2003 On the product listing pages, you would have to either add a form to each row or find a way to catch all the quantity boxes. Note: the recently released Master Products contribution does something like this. Maybe it might fit your needs, or you could steal code from it for your purposes. Hth, Matt
themutantchair Posted November 30, 2003 Posted November 30, 2003 I tried adding a form to each row, but I can't figure it out. I've looked at master products, and it's not going to work for me. I'm really rather stuck, which is bad because my customer REALLY wants this feature one their site.
Guest Posted November 30, 2003 Posted November 30, 2003 I tried adding a form to each row, but I can't figure it out. Take another look at how its done in Master Products - there is only one form which covers all the rows - the file is includes/modules/master_listing.php... or, look at one of the 'multiple' contributions (product_listing.php). Matti
Guest Posted November 30, 2003 Posted November 30, 2003 Do you mean like this? Link It does not have a buy now button next to each row, but rather a single add to cart button below the list. It is just this contribution http://www.oscommerce.com/community/contributions,1129 With the file modified a bit to add the images and align the rows a bit better if you do not use attributes. I posted my file here: http://www.oscommerce.com/forums/index.php?showtopic=39875&st=30
Kristofor Posted November 30, 2003 Posted November 30, 2003 Does this work with Ms2?? Don't die with the music in you!!! Failure is just another boundary to sucess!!! But that doesn't mean your getting somewhere...
Kristofor Posted November 30, 2003 Posted November 30, 2003 ok, does someone know how to do it individually, not for the whole list, and have it working with ms2, please let me know thanks Don't die with the music in you!!! Failure is just another boundary to sucess!!! But that doesn't mean your getting somewhere...
Guest Posted November 30, 2003 Posted November 30, 2003 To make it so that your quantities only work one row at a time, change (around lines 131-4 of includes/modules/product_listing.php) 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', IMAGE_BUTTON_BUY_NOW) . '</a> '; break; to case 'PRODUCT_LIST_BUY_NOW': $lc_align = 'center'; $lc_text = tep_draw_form('buy_now' . $listing['products_id'], tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']), 'GET') . tep_draw_input_field('quantity', '1') . tep_image_submit('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</form> '; break; and around line 367 of includes/application_top.php, change $cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+1); to $cart->add_cart($HTTP_GET_VARS['products_id'], ((isset($HTTP_GET_VARS['quantity'])) ? $HTTP_GET_VARS['quantity']) : $cart->get_quantity($HTTP_GET_VARS['products_id']) + 1)); Note: first, this code replaces the quantity in the cart with the one that is picked (i.e. if you have 3 in the cart and select 2 here, you will have 2 in the cart, not 5); second, I'm not sure that there is any real gain doing it this way over a method that handles all the rows (except that it is simpler to write) and there is a loss. Under this method, if someone changes quantities in a row but clicks the buy_now button in a different row, the quantity change in that row will be lost. Some customers will probably find that confusing. Hth, Matt
Kristofor Posted November 30, 2003 Posted November 30, 2003 so, is that all i need to add, no contributions or anything, because i put that in and the product listing doesnt even show up, i just get a blank screen, Don't die with the music in you!!! Failure is just another boundary to sucess!!! But that doesn't mean your getting somewhere...
Kristofor Posted November 30, 2003 Posted November 30, 2003 i think it has something to do with the code for the application_top, if i dotn change that the quantitybox shows up, just what would be wrong with the code in application top????? Don't die with the music in you!!! Failure is just another boundary to sucess!!! But that doesn't mean your getting somewhere...
Guest Posted November 30, 2003 Posted November 30, 2003 Looks like the () were wrong, try $cart->add_cart($HTTP_GET_VARS['products_id'], ((isset($HTTP_GET_VARS['quantity'])) ? $HTTP_GET_VARS['quantity'] : ($cart->get_quantity($HTTP_GET_VARS['products_id']) + 1)); Hth, Matt
Kristofor Posted November 30, 2003 Posted November 30, 2003 nup, still no luck, Don't die with the music in you!!! Failure is just another boundary to sucess!!! But that doesn't mean your getting somewhere...
Guest Posted November 30, 2003 Posted November 30, 2003 $cart->add_cart($HTTP_GET_VARS['products_id'], ((isset($HTTP_GET_VARS['quantity'])) ? $HTTP_GET_VARS['quantity'] : ($cart->get_quantity($HTTP_GET_VARS['products_id']) + 1)));
Kristofor Posted December 1, 2003 Posted December 1, 2003 ok, i havent tried that, i installed b2bsuite and its good, because it had this option, Don't die with the music in you!!! Failure is just another boundary to sucess!!! But that doesn't mean your getting somewhere...
Kristofor Posted December 2, 2003 Posted December 2, 2003 ok, because b2bsutie does not properly work i went back to this method, but when i click buy now, it doesnt add anything to the cart, the page just refreshes to the index.php page. whats going on?? Don't die with the music in you!!! Failure is just another boundary to sucess!!! But that doesn't mean your getting somewhere...
chfields Posted December 2, 2003 Posted December 2, 2003 easy way add Qty box in your product_info.php 1. copy this code near your in_cart button in product_info.php, actually you can add this code anywhere. --------------------------------------------- <input type="text" name="quantity" value="1" maxlength="2" size="2"> -------------------------------------------- 2. search your application_top.php find this code: --------------------------------------------- $HTTP_POST_VARS['id']))+1 -------------------------------------------- replace with this one ------------------------------------------ $HTTP_POST_VARS['id']))+$quantity ------------------------------------------ done!
Kristofor Posted December 2, 2003 Posted December 2, 2003 i did that, but it only adds one item to the cart what am i doing wrong, can u give me an example of hwere to put this code? Thanks kristofor Don't die with the music in you!!! Failure is just another boundary to sucess!!! But that doesn't mean your getting somewhere...
Guest Posted December 2, 2003 Posted December 2, 2003 ok, because b2bsutie does not properly work i went back to this method, but when i click buy now, it doesnt add anything to the cart, the page just refreshes to the index.php page.whats going on?? It looks like you are missing the 'GET' parameter from the tep_draw_form call. It's doing a form post instead, which doesn't match the other code. Hth, Matt
Kristofor Posted December 2, 2003 Posted December 2, 2003 ok so what do i do then?? Don't die with the music in you!!! Failure is just another boundary to sucess!!! But that doesn't mean your getting somewhere...
themutantchair Posted December 2, 2003 Posted December 2, 2003 Thanks, Matt. You're awesome. I've got this running on my site. Unfortunately, there are two bugs: The quantity field is too big (easily fixable, I'm sure) The buy now button takes me to the login page (a much bigger problem) It's up at www.scrapbookersparadise.com/catalog/ Any ideas what's wrong?
themutantchair Posted December 2, 2003 Posted December 2, 2003 Actually, it takes me to the index page.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.