This is a discussion on Only product in category : Product list to product information page within the New osCommerce Contributions forums, part of the osCommerce 2.2 Forums category; Hi.. This is my first contribution. Starting out with a simple one. I frequently get clients asking for this feature. ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| ||||
| ||||
| Hi.. This is my first contribution. Starting out with a simple one. I frequently get clients asking for this feature. so i thought it would save time and money for the client ( any sop owner ) looking for a fix. This change to the index.php makes sure that the customer/user is redirected to the products information page in case there is only one product in the particular category. ======================================= 1. find the line: if (isset($cPath) && tep_not_null($cPath)) { $categories_products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'"); $cateqories_products = tep_db_fetch_array($categories_products_query); if ($cateqories_products['total'] > 0) { Add in the following code below the above code snippet. if ($cateqories_products['total'] == 1) { $query = tep_db_query("select p2c.products_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where categories_id = '" . (int)$current_category_id . "'"); $prods_arr = tep_db_fetch_array($query); $prods_id = $prods_arr['products_id']; tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO,' products_id='.$prods_id)); } that should the fix for that. Any contributions welcome (we even accept and consider a thank you to be great one for this one). Good Luck with new shop. Cheers Harishyam Services yahoo: feenix_666 More...
__________________ Michael Sasek osCMax Developer
|
| Sponsored Links | ||
| ||
| Thread Tools | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Product List by Category | michael_s | New osCommerce Contributions | 0 | 12-10-2007 05:11 AM |
| Product List by Category | michael_s | New osCommerce Contributions | 0 | 11-25-2007 06:02 AM |
| Product List by Category | michael_s | New osCommerce Contributions | 0 | 11-25-2007 04:37 AM |
| Add Orders Statistics for each product in admin product list | michael_s | New osCommerce Contributions | 0 | 05-27-2007 10:13 PM |
| Product Description in Category and Manufacturer List | know | osCommerce 2.2 Modification Help | 0 | 10-31-2002 05:42 AM |