Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Linking to a category or subcategory within Store


Zima

Recommended Posts

Hello,

 

I have manually created links to my categories and subcategories for my category box.

 

My question is what is the smart way to link so the user doesn't get logged out and is Bot friendly.

 

Example:

Right now it is <a href="/index.php/cPath/21">

 

The full url i.e. <a href="http://www.domain.com/index.php/cPath/21"> logs the user out as it is missing the ID.

 

Any suggestions? I am totally new at PHP. How to link to a category within the store?

 

Thanks!

Link to comment
Share on other sites

Dunno about "bot friendly", but, eg.

 

<?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=21') . '">' . YOUR_LINK_DEFINE . '</a>'; ?>

 

You will need to know the cPath to where you wish to travel :P

 

Matti

Link to comment
Share on other sites

Matti

 

Is there a method to pull a specific category say as in above cPath=21 and display the contents of that category in a page

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

Perhaps you mean something like this?

 

<?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=1_4') . '">' . YOUR_LINK_DEFINE . '</a>'; ?>

 

Matti

Link to comment
Share on other sites

Matti

 

The idea is to have a link in the top nav bar that opens the category in a new page showing all the products within that category.

 

Will the above code produce this result.

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

You can do that like this:

 

<?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=1_4') . '" target="_blank">' . YOUR_LINK_DEFINE . '</a>'; ?>

 

Matti

Link to comment
Share on other sites

Thanks Matti

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

Much Appreciated Matti!

 

PS. If the link name is more than one word i.e. "Hot Items" , I get a parse error. I replaced YOUR_LINK_DEFINE with the word "Hot Items". I guess it's a formatting error.. One word links work perfectly

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...