Jump to content



Latest News: (loading..)

- - - - -

Link of some Subcategories must be linking to another Site

subcategory oscommerce php

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#-19   nitromethan

nitromethan
  • Members
  • 1 posts

Posted 11 April 2012 - 01:08 PM

Hello,

I have a osCommerce V2.2 RC2 with some Categories and Subcategories. By some Subcategories I want to link to another Page. For the survey at the middlecontainer I did this on this way in the index.php:

<tr><td class="name name4_padd">'; if($categories['categories_name'] == "Subcategory1") { echo '<a href="myownPage.php">Subcategory1</a>'; }  else if($categories['categories_name'] == "Subcategory2") { echo '<a href="myownPage1.php">Subcategory2</a>'; } else { echo  $p_name_sub; } echo '</td></tr>';

It works well! But how I can do this for the Navigation ? I mean:

Category1

Subcategory1  ---> must be linking to myownPage.php

Subcategory2  ---> must be linking to myownPage1.php

Subcategory3  ---> linking normal

Subcategory4  ---> linking normal

Category2

Subcategory1  ---> linking normal

Subcategory2  ---> linking normal


I hope you know what i mean....

Thanks a lot!


best regards

Edited by nitromethan, 11 April 2012 - 01:11 PM.


#-18   Switch

Switch
  • Members
  • 8 posts

Posted 11 April 2012 - 08:31 PM

Are you talking about the Categories menu?

Probably easier to just do by cPath.

In boxes/categories.php you could try modifying the categories string where it builds the url.  This is untested, also from a 2.3, but probably the same.
$categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">';

To...

$cPathVar = $tree[$counter]['path'];  
switch ($cPathVar) {
case '2_19': // Your Custom Page cPath
	  $categories_string .= tep_href_link('your_custom_page.php').'">';
  break;
case '2_18': // Your Custom Page cPath
	  $categories_string .= tep_href_link('your_custom_page.php').'">';
  break;
default:
	  $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">';  
  break;
}

You could also use if else if thats eaiser.

This is untested and not from a MS2.2, so backup!