Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Category into a link


LeeFoster

Recommended Posts

@LeeFoster You will need to code that. Below are a few ways to do it that I can think of at the moment. But unless there is some reason to have the link be a category, I would just delete that category and add the link manually, which is similar to the second method below. Leaving it as a category will always be a potential problem because if you install an addon that lists or uses categories, its code may require changing. And if you forget, it could cause a problem on your site.

- Edit the classes/categories_tree.php and change the code to look for that categories ID and add the url you want for it. Something like

if (categories_id = 33) {
  url = somehwhere else;
} else {
  original code goes here
}

- Edit the above file and change the database query not to include the category in the result. Then in the categories infobox, add a link after the rest of the categories for the one you want.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

17 minutes ago, Jack_mcs said:

@LeeFoster You will need to code that. Below are a few ways to do it that I can think of at the moment. But unless there is some reason to have the link be a category, I would just delete that category and add the link manually, which is similar to the second method below. Leaving it as a category will always be a potential problem because if you install an addon that lists or uses categories, its code may require changing. And if you forget, it could cause a problem on your site.

- Edit the classes/categories_tree.php and change the code to look for that categories ID and add the url you want for it. Something like


if (categories_id = 33) {
  url = somehwhere else;
} else {
  original code goes here
}

- Edit the above file and change the database query not to include the category in the result. Then in the categories infobox, add a link after the rest of the categories for the one you want.

This is going to be for the category on the index page not the categories box, will it still work?

Link to comment
Share on other sites

33 minutes ago, LeeFoster said:

This is going to be for the category on the index page not the categories box, will it still work?

Making the change in the class file will affect any code in the shop that displays categories assuming the class is used to get the categories. Changing the code in the module as @burtmentioned is a better way since it won't affect core files, but it will only apply to that one module.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

20 hours ago, LeeFoster said:

Took a little trial and error to get it right but I have managed to do so, thanks.

Is it a secret or are you going to tell how you did it in case others find this thread.

 

REMEMBER BACKUP, BACKUP AND BACKUP

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...