Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

straight to product_info from categories?


Twice_knightly

Recommended Posts

Hi

 

Please could somebody help me out, in my store I have a category which contains only 1 product, when the customer clicks on the category I'd like it to display the product info page for the product instead of going to the index.php page and the customer having to click again on the item to get to the details/checkout.

 

Is this possible in osc ?

 

Many thanks

Cheers

Carl.

Link to comment
Share on other sites

Hi

 

Please could somebody help me out, in my store I have a category which contains only 1 product, when the customer clicks on the category I'd like it to display the product info page for the product instead of going to the index.php page and the customer having to click again on the item to get to the details/checkout.

 

Is this possible in osc ?

 

Many thanks

Cheers

Carl.

 

do you mean sub-category or category? anyhow the point of concern that you have to modify is between lines 26-34 in boxes/categories.php.

 

 $categories_string .= '<a href="';

   if ($tree[$counter]['parent'] == 0) {
     $cPath_new = 'cPath=' . $counter;
   } else {
     $cPath_new = 'cPath=' . $tree[$counter]['path'];
   }

 

The first $cPath_new will indicate the path for the category (example: Hardware)

The second $cPath_new will indicate the path for a sub-category (example: Mouse)

 

$categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">';

 

This string basically creates the link. FILENAME_DEFAULT which if you look up in includes/filenames.php line 38 is index.php. If you wanted to change that to the product page youll do something like tep_href_link(FILENAME_PRODUCT_INFO, $cPath_new). Now this suggestion may be a solution for the sub-category and if thats the case you'll have to add additional lines of code to the above osCommerce code by looking at the index.php and seeing how they specify the call to the PRODUCT_INFO page.

 

bye,

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...