Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

where can I find the title name?


leahdosa

Recommended Posts

I am trying to link a button to a paticular category using this code:

 

<a href="<?php echo tep_href_link('index.php', 'cPath=21&', 'NONSSL'); ?>">Category Name Here</a>

 

but I don't know where to find the 'category name'. On my oscommerce platform, the name of the category I'm working with is 'short skirt sets', but that's not linking it correctly. I tried using that name without the spaces, but still not linking. Any advice???

 

-Leah

Link to comment
Share on other sites

I am trying to link a button to a paticular category using this code:

 

<a href="<?php echo tep_href_link('index.php', 'cPath=21&', 'NONSSL'); ?>">Category Name Here</a>

 

but I don't know where to find the 'category name'. On my oscommerce platform, the name of the category I'm working with is 'short skirt sets', but that's not linking it correctly. I tried using that name without the spaces, but still not linking. Any advice???

 

-Leah

 

The category name is held in the database. It may be that a request has already been made to the database earlier in your code that has recovered the category name you're after, so you might be able to use the already defined variable, without needing to request the category name from the database again. Otherwise, perhaps some code like the following can be used to get it from the database?

 

<?php
// assuming your category id is stored in $category_id
$category_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$category_id . "' and language_id = '" . (int)$languages_id . "'");
$category = tep_db_fetch_array($category_query);
echo '<a href="' .  tep_href_link('index.php', 'cPath='.$category_id.'&', 'NONSSL') . '">' . $category['categories_name'] . '</a>';
?>

Just a thought?

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...