![]() |
adding custom sql
Hi
i wanted to add a list of my categories in a x cart page (.tpl file), i wanted to pull the categories out of the xcart_categories table, i tried using a PHP/MySQL connect, but that did not work, does anyone if x cart has it's own "special" code to connect to the database or some code to query the database? thanks |
Re: adding custom sql
Hi
doesnt anyone know how to do this???/ please help! |
Re: adding custom sql
You need an example of how to connect to database "X-CART and the list of categories?
Or would you prefer that the "X-CART" is not appealed to the database to select categories? |
Re: adding custom sql
Quote:
The categories array should be available to you throughout the cart - just loop through that instead of trying to add yet one more array to what is in memory. |
Re: adding custom sql
Hi
how would i list the categories array? and also i need the categories to be link their respective detail page. thanks for the help. |
Re: adding custom sql
Quote:
basically i want to list my categories on a page and have them linked to their respective page, i want to achieve this the most efficient way. i just thought a database connect and select statement would work for me, if there another easier way, then please let me know! thanks |
Re: adding custom sql
Quote:
A simple way, open file "skin1/customer/categories.tpl" find line: {capture name=menu} and after insert next code (for link to url test.php, test1.php, test2.php): PHP Code:
If you need more additional links (in categories list) add similar. |
Re: adding custom sql
Hi
thanks for your reply. i think you may have misunderstood me, i dont want to add more categories, i want to display my existing categories on another static page, not in my categories page. please tell me if i have misunderstood you. can you help me with that? thanks |
Re: adding custom sql
skin1/customer/categories.tpl still has the answer to your question. You will see a {section} section that loops through the categories array and displays the name and the link. This will show you exactly how to do it.
|
Re: adding custom sql
thanks, i shall have a look at the file and have a go at it.
thanks |
All times are GMT -8. The time now is 04:30 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.