X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   Showing all categories, subcategories and sub-subcategories (https://forum.x-cart.com/showthread.php?t=77791)

siddharth.puri@wheelandba 05-07-2020 10:51 PM

Showing all categories, subcategories and sub-subcategories
 
Hi I am trying to show all categories, subcategories and sub-subcategories on a single page.

How can I achieve this?

Thanks and Regards,
Sid

Ed B. 07-04-2020 11:32 PM

Re: Showing all categories, subcategories and sub-subcategories
 
Code:

$categories = \XLite\Core\Database::getRepo('XLite\Model\Category')->findAll();
should do the job. (Categories, subcategories, sub-subcategories are all stored as entries of
xc_categories table).

siddharth.puri@wheelandba 07-07-2020 06:34 PM

Re: Showing all categories, subcategories and sub-subcategories
 
Hi Ed,

Thanks for your reply.

I am trying to show display them to the customer area.

Where do I add this code?

I created a new page following this - https://devs.x-cart.com/basics/creating_new_page.html#creating-page-in-customer-area

Now, how do I display all Categories, subcategories, sub-subcategories here?

Kind Regards,
Sid

Ed B. 07-07-2020 11:14 PM

Re: Showing all categories, subcategories and sub-subcategories
 
Inside body.twig.


Basically you define categories in the view class so that they are accessible from twig and you loop over them in the twig.


All times are GMT -8. The time now is 02:09 AM.

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