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



Find us on Facebook
Go Back   osCommerce and osCMax shopping cart software forums > osCommerce 2.2 Forums > New osCommerce Contributions

Connect with Facebook Register FAQDonate Members List Calendar Mark Forums Read


Closed Thread

 

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: 15,708
Thanks: 139
Thanked 606 Times in 519 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

*** Do not PM me requesting paid help. The only paid work I do is for AABox Web Hosting customers ***

Stay Up To Date with everything osCMax:
Free osCMax Newsletters - Security notices, New Releases, osCMax News
osCMax on Twitter - Up to the minute info as it happens. Know it first.

osCMax User Manual - osCMax Templates - Advanced Template Tutorial

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Closed Thread

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 03:01 AM.


Powered by vBulletin®
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO
Copyright 2009 osCMax
Inactive Reminders By Icora Web Design