osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 
 

Only product in category : Product list to product information page

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. ...


Go Back   osCommerce and osCMax shopping cart software forums > osCommerce 2.2 Forums > New osCommerce Contributions

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Reply

 

LinkBack Thread Tools
  #1  
Old 01-29-2008, 01:22 AM
michael_s's Avatar
osCMax Developer

 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 10,426
Thanks: 73
Thanked 334 Times in 313 Posts
Rep Power: 10
michael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond repute
Post Only product in category : Product list to product information page

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


  • osCMax Templates - Hundreds of premium quality templates. New designs every month!

  • xShop for osCMax - Windows Based osCMax administration. Improved workflow, security, speed and convenience.

  • osCMax Hosting - From basic hosting to High Availability, Load Balanced arrays, the most experienced osCMax host.

  • osCMax Template Tutorial - Learn how to make your own custom templates and how to use the powerful features of the osCMax template system.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Advertisement
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

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


All times are GMT -8. The time now is 09:12 AM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
http://www.oscmax.com/forums/
Copyright 2008 osCMax