Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

how-to: get category from item URL


kkhipple

Recommended Posts

using this bit of code:

 

' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '

 

 

i am able to imbed that in the <A HREF=""> HTML tag, but how do I create the category link so i can point the user to products within that items category.

 

 

please help me out... thx in advance

Link to comment
Share on other sites

Hi,

 

using this bit of code:

 

' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '

i am able to imbed that  in the <A HREF="">  HTML tag, but how do I create the category link so i can point the user to products within that items category.

please help me out... thx in advance

 

Usually the url for a product resolves to:

 

http://example.com/product_info.php?products_id=55

 

and by category would resolve to (for example):

 

http://example.com/product_info.php?cPath=...&products_id=55

 

so, at a guess, try this:

 

tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . $cPath . '&products_id=' . $HTTP_GET_VARS['products_id'])

 

Peter

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...