Contributions

Features (Category Index)
Search: 

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>&nbsp;';
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>&nbsp;';
break;
}

Expand All / Collapse All

Extra change iseecom 13 Jun 2007

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.

Contrib that worked for me Alex Norden 14 Oct 2004
AddQuantityToListingv1.2 Aernout Koole 22 Sep 2004
Add Quantity to Listings v1.1 Raven 30 Aug 2004
Added Qty text next to box Mike Benstead 11 Aug 2004
AddQuantityToListing v1.0 Joachim Ott 3 Aug 2004
Quantity errors Raven 1 Jun 2004
Add Quantity to Listings agiftco.com 21 May 2004

Note: Contributions are used at own risk.