Show product listing as Homepage

Od Neznámé
Členem od pro -0001

Hi, my name is Denise. I just started looking into litecart and would like to change the homepage to just show a listing of all products either all categories incl. subcategories merged together or one particular category. Is there a setting in the admin backend that I am overlooking? 
In what file can I change what will be served for the content section of a page?

tim
Founder
Od Sweden
Členem od kvě 2013
tim

This requires LiteCart to crawl through all subcategories before fetching all the products and there is no current feature like that. You would have to rewrite func_catalog and the method catalog_products_query to grab all products of the category id and all subcategory ids. These are not known so crawling is necessary first.

Od Neznámé
Členem od pro -0001

Thank you for replying and replying fast. Is e.g. the "Green Duck" under the Subcategory just a reference to the "Green Duck" under the main category Rubber Ducks (they have the same product code RD002)? Couldn't the visit of the homepage trigger a show category, like when clicking on a category link (kind of called from the template without modifying anything outside the template)?

 Rubber Ducks
    Subcategory
      Green Duck
      Yellow Duck
 Green Duck
 Purple Duck
 Red Duck
 Yellow Duck

tim
Founder
Od Sweden
Členem od kvě 2013
tim

You can mount a product inside multiple categories. I think that is what you are refering to.

Couldn't the visit of the homepage trigger a show category, like when clicking on a category link (kind of called from the template without modifying anything outside the template)?

I'm not sure what you mean. Do you want the first page (home) to be an alias for a category page e.g. /category?category_id=1 ?

Od Neznámé
Členem od pro -0001

The alias could serve as a temporary solution. If I may talk about Prestashop from which I would actually like to escape for the small project I am working on right now - as example what I am looking for, there are ways in Prestashop: e.g. through the Featured Products on the Homepage module or a modification like described in this tutorial "Category page as "homepage" of your store" https://mypresta.eu/en/art/developer/category-page-as-landing-page-of-your-prestashop.html maybe something similar like the small modification could be easily done in litecart.

tim
Founder
Od Sweden
Členem od kvě 2013
tim

Here is my add-on for featured products https://www.litecart.net/addons/72/featured-products

If you want to redo your index page just create a custom box and include it in includes/templates/mytemplate.catalog/views/index.inc.php.

Od Neznámé
Členem od pro -0001

Deleted my post with a question - I will have a look at the problem again tomorrow, maybe I will figure it out a bit further myself.

tim
Founder
Od Sweden
Členem od kvě 2013
tim

When including the box straight in the view file there is no need to store it as a snippet. So step 3 is redundant.

includes/boxes/box_category_products.inc.php does not output any HTML so therefore it needs a view file for stitching the snippets with.

Od Neznámé
Členem od pro -0001

OK, I have to go through it again and see.

tim
Founder
Od Sweden
Členem od kvě 2013
tim

An example of a view file

Od Neznámé
Členem od pro -0001

Thank you, this worked.

Od Neznámé
Členem od pro -0001

Why not just modify the "views/index.inc.php" ?

Kill the content and add search box reference thru or category list there ?

LiteCart Fan
Od Bulgaria
Členem od led 2021

Hello, I'm also trying to get products on the home page, for example, from category 4, how do I do it?

tim
Founder
Od Sweden
Členem od kvě 2013
tim

@vladislaw You could clone one of the boxes on the main page and change the query to fetch a category.


  'categories' => [4, 5, 6],
  'limit' => 10,
]);```
https://github.com/litecart/litecart/blob/2.5.4/public_html/includes/templates/default.catalog/pages/index.inc.php
https://github.com/litecart/litecart/blob/2.5.4/public_html/includes/boxes/box_latest_products.inc.php
https://github.com/litecart/litecart/blob/2.5.4/public_html/includes/templates/default.catalog/views/box_latest_products.inc.php
LiteCart Fan
Od Bulgaria
Členem od led 2021

Done thanks!

Vy
This website uses no cookies and no third party tracking technology. We think we can do better than others and really think about your privacy.