Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Add a hyperlink to the categories box


biohazardbill

Recommended Posts

How can I add a hyperlink to the categories box...

 

I tried adding it in the box but it puts it either above or below the box....

 

or how could you add a product so that it shows up in the categories box?

 

I have a couple items that dont need to be in a category because the category and product name would be the same therefore a prospective customer should not have to click twice...

Link to comment
Share on other sites

In /catalog/includes/boxes/catagories.php around line 131 maybe find this code

 

$info_box_contents = array();

$info_box_contents[] = array('text' => $categories_string);

add this with your link after it

 

$info_box_contents [] = array('align' => 'left',

'text' => '<a href="http://YOUR LINK.com"target="_blank">YOUR TEXT</a>')

Link to comment
Share on other sites

In /catalog/includes/boxes/catagories.php around line 131 maybe find this code

 

$info_box_contents = array();

  $info_box_contents[] = array('text' => $categories_string);

add this with your link after it

 

  $info_box_contents [] = array('align' => 'left',

  'text' => '<a href="http://YOUR LINK.com"target="_blank">YOUR TEXT</a>')

 

 

Can anyone tell me what i need to add to the code to make my hyperlink show in the middle section of the site instead of the hyperlink opening a new page?

 

Thanks

 

Andy

Link to comment
Share on other sites

Remove the target="_blank" from the supplied link. However, if you are linking to to a page in oyur site, you need to be using the tep_href_link function. A standard html link will cause you to lose sessions.

 

Jack

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

It's part of the built in code that is designed to be used for this purpose. The basic structure is

<?php echo tep_href_link('some_page.php', '', 'NONSSL'); ?>

If you search your files for it, you will find many examples. Or post here if you need help creating the link.

 

Jack

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

Remove the target="_blank" from the supplied link. However, if you are linking to to a page in oyur site, you need to be using the tep_href_link function.  A standard html link will cause you to lose sessions.

 

Jack

 

 

Ok glad this was covered because I didnt even think of that....

 

how would i create the link to a specific product so that I don't lose the session?

Link to comment
Share on other sites

Ok glad this was covered because I didnt even think of that....

 

how would i create the link to a specific product so that I don't lose the session?

 

This is the link to the actual product in my oscommerce application:

 

http://www.mydomain.com/product_info.php?p...7396f86b9bb0ef4

 

I would like the word inspections to show up in the category infobox...

 

Also how would you create more than one link as well?

Link to comment
Share on other sites

Ok now I am confused... this is what I have...

 

$info_box_contents = array();

$info_box_contents[] = array('text' => $categories_string);

$info_box_contents[] = array('align' => 'left', 'text' => '<br><a href="' . tep_href_link('product_info.php?products_id=6&', '', 'NONSSL') . '">' . Inspections . '</a>');

 

new infoBox($info_box_contents);

?>

</td>

</tr>

<!-- categories_eof //-->

 

It shows up in the info box... yay... however there is a space between the regular categorries and the one i entered... how do I get rid of that...

 

This is where I am confused...

when you hover over the link with the mouse, you know how you get the preview of the link you are about to go to on the bottom of Internet Explorer, well I got it to match the link that also shows when I hover over the item in the New Items for January Box. When I click the link in the infobox it goes back to the index page... when I click the one in the new products for january box it goes to the product... if the links match... including session id... why doesnt it work?

Link to comment
Share on other sites

New Development:

 

I removed:

?products_id=6&

 

and it works sorta...

 

It goes to the products page.... it has the session id...

but no product...

 

How can I get it to reference a certain product?

 

I am trying to figure it out... but having a hard time...

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...