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)
-   -   Specific Category on Home Page (https://forum.x-cart.com/showthread.php?t=72459)

mcpilot 07-20-2015 02:02 AM

Specific Category on Home Page
 
I would like to display a specific category of products on the home page. I wish to embed the code in the welcome.tpl file where it will lay out where I want the products to display. I am having trouble locating code that will allow this. Can anyone help?

qualiteam 07-20-2015 03:04 AM

Re: Specific Category on Home Page
 
Hello!

"\XLite\View\ItemsList\Product\Customer\Category\M ain" is the base widget that renders the list of products from a category.

It has PARAM_CATEGORY_ID parameter, so I believe you can render it for a specific category from a template file (however, I'm not sure for 100% as it may take some parameters from the request and from the controller that handles the current "target").

The code could be as follows (I haven't tried it):
Code:

<widget class="XLite\View\ItemsList\Product\Customer\Category\Main" categoryid="YOUR_CATEGORY_ID" />

mcpilot 07-20-2015 03:31 AM

Re: Specific Category on Home Page
 
This is for x-cart 4.6.3. It looks like the code you posted above may be for litecommerce?

qualiteam 07-21-2015 05:17 AM

Re: Specific Category on Home Page
 
Opps... Yes, you're right. The code above is for X-Cart 5.

I believe doing this in X-Cart 4 is a more complex task than adding a few lines into the template file. I'm not sure if I can give you a detailed instruction, though.


All times are GMT -8. The time now is 05:28 PM.

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