Contributions
Add Quantity to Listings
*ZIP FILE SAYS SAME THING*
To add a quantity field in the product listing view go to
includes/modules/product_listing.php
replace
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;
}
With
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']), 'POST') . tep_draw_input_field('list_quantity', '1', 'size=2') . tep_image_submit('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</form> ';
break;
}
Expand All / Collapse All
After making the changes mentioned in the last post, you also need to ADD:
elseif (isset($HTTP_POST_VARS['cart_quantity']))
{
$cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+$HTTP_POST_VARS['cart_quantity']);
}
in the catalog/includes/application_top.php
After:
case 'buy_now' : if (isset($HTTP_GET_VARS['products_id']))
{
if (tep_has_product_attributes($HTTP_GET_VARS['products_id']))
{
tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']));
}
Hope it would help.
If this addon does not work for you (did not work for me, I have a modded site I guess)
try this one by Acheron, don't download here, go to his contrib<a href=http://www.oscommerce.com/community/contributions,2147/> worked out of the box for me</a>
http://www.oscommerce.com/community/contributions,2147/
added a small modification so you can define "Qty" in the language index.php files e.g. catalog/includes/languages/english/index.php
Rather then adding quantity one by one, is it possible to add the following feature to this mod;
to change mulitple 'Quantities' with the click of one button at the bottom of the page?
Added the text Qty: next to the box and spaced the box a little from the buy now button
This should fix the problem to not work in earlier version.
Great idea but it doesn't do what you really want.
when adding a quantity more than 1 item it doesn't save it. it just defaults to 1 item again in basket.
also there is no QTY title.
what i would liketo do is a multiple submission. is this possible & can any1 helpme with this?
*ZIP FILE SAYS SAME THING*
To add a quantity field in the product listing view go to
includes/modules/product_listing.php
replace
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;
}
With
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']), 'POST') . tep_draw_input_field('list_quantity', '1', 'size=2') . tep_image_submit('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</form> ';
break;
}
Note: Contributions are used at own risk.