fraro Posted February 24, 2003 Posted February 24, 2003 I've read the FAQ in osCommerce Community and i found something interesting. I want to display the question quantity in productlist, and i found this: It is possible to display the quantity to buy and the add to cart button right on the product listing, to be able to place the order right from the product listings without having to click for the extended description. In /includes/modules/product_listing.php, replace: case 'PRODUCT_LIST_BUY_NOW': $lc_align = 'center'; $lc_form = '<form method="post" action="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=add_update_product', 'NONSSL') . '">'; $lc_text = ' <input type="hidden" name="cart_quantity" value="1"><input type="hidden" name="products_id" value="' . $listing_values['products_id'] . '">' . tep_image_submit(DIR_WS_IMAGES . 'button_buy_now.gif', TEXT_BUY . $listing_values['products_name'] . TEXT_NOW) . ' '; With: case 'PRODUCT_LIST_BUY_NOW': $lc_align = 'center'; $lc_form = '<form method="post" action="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=add_update_product', 'NONSSL') . '">'; $lc_text = ' <input type="text" name="cart_quantity" value="1" maxlength="2" size="2"><input type="hidden" name="products_id" value="' . $listing_values['products_id'] . '">' . tep_image_submit(DIR_WS_IMAGES . 'button_buy_now.gif', TEXT_BUY . $listing_values['products_name'] . TEXT_NOW) . ' '; But when I searched for this I didn't find it. Why? My code looked like this: 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> '; What should i do?
Ajeh Posted February 24, 2003 Posted February 24, 2003 That example is rather old. You will have to adapt it to the current code. Also, in the Attributes Sorter Copier v5.1 I have something you can look at in the /includes/modules/product_listing.php file that does this for multiple products at one time. You have to get that version off my site. I should have the new versions out and in the contributions any day ... hopefully sooner rather than later. I am adding in some finishing touches ... I hope they are finishing touches ... :shock:
Recommended Posts
Archived
This topic is now archived and is closed to further replies.