X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Calling up category as a link? (https://forum.x-cart.com/showthread.php?t=15659)

Tristan 08-03-2005 07:12 AM

Calling up category as a link?
 
Hello

How can i call up the category of the product you are viewing as a link?
I am trying to add a link (view all items in this category) in my related products tpl.

I've tried variations on
Code:

<a href="home.php?cat=xxxxxxx">
but always end up on the homepage.

Any help or pointers would be greatly appreciated.
Thanks :)

balinor 08-03-2005 08:39 AM

That is indeed the correct way to link it......

Tristan 08-03-2005 09:22 AM

Sorry i'm not very good at getting my point across or PHP coding.

I tried this code from trial and error but it brings up the link to the very 1st category i inputed into database and not the category of the product that i'm currently viewing.


TelaFirma 08-03-2005 09:49 AM

Re: Calling up category as a link?
 
In your first post you say:

Quote:

I am trying to add a link (view all items in this category) in my related products tpl.

Well, the issue here really is that the query to get the related products does not look up the primary Category ID and add it to the respective product in the $recommends array (or the $product_links array - there are two different modules that will generate the links for you like that).

So to get this to work like you want, you would need to hack the recommends.php in the root dir and also the /modules/Upselling_Products/related_products.php file to query the xcart_products_categories table and add that to the array.

Tristan 08-03-2005 10:07 AM

Thank you for the answer.

Now that you've pointed out that related products does not look up the primary category id i feel a bit of a dufus. But hey if you don't ask you don't get.

Hopefully i can do this now.
Thanks again :)


All times are GMT -8. The time now is 03:34 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.