Jump to content

How to show all products


Recommended Posts

I believe that in order for you to atchieve that, you need to create a common tag.
for example, make a new tag and call it all products and make sure that every single product has this tag.

once that is done, you can either click on the tag or link to it.

  • Like 1
Link to comment
Share on other sites

Hi Everyone,

Right, for now the option to show all products is just wanted by me.
So if it were easier to do something in the back office just so the administrator (me) could bring up a list of all products that would be fine.
Only thing is I am wanting to do this to check how all products are in the shop, as I've had problems with failing csv file imports, hence needing to trawl through the shop to make sure it's all ok.



Regards

Link to comment
Share on other sites

  • 2 weeks later...

Updating this again:-

I am still looking for a while in either the front end or the back office, to show a list (including pictures, price, name, ID, description) of all products in my shop.
I do not care about the server load (althogh my hoster might :-) ) as it is to be used only by me when I need it and disabled from the front end when I do.

Anybody?

Link to comment
Share on other sites

  • 1 year later...

The right way (without tags or categories) is to create two new files. I'd call them Products.php and Products.tpl.

1. Upload Products.php with the following code to the root directory (/):

<?php

include(dirname(__FILE__).'/config/config.inc.php');
include(dirname(__FILE__).'/header.php');

include(dirname(__FILE__).'/product-sort.php');

$nbProducts = intval(Product::getNewProducts(intval($cookie->id_lang), isset($p) ? intval($p) - 1 : NULL, isset($n) ? intval($n) : NULL, true));
include(dirname(__FILE__).'/pagination.php');

$smarty->assign(array(
   'products' => Product::getNewProducts(intval($cookie->id_lang), 0, 10, false, $orderBy, $orderWay),
   'nbProducts' => intval($nbProducts)));

$smarty->display(_PS_THEME_DIR_.'products.tpl');

include(dirname(__FILE__).'/footer.php');

?>




2. Upload Products.tpl with the following code to your theme's folder (/myshop/themes/prestashop/, for ex.):

capture name=path}{l s='Products'}{/capture}
{include file=$tpl_dir./breadcrumb.tpl}

{l s='Products'}

{if $products}
   {include file=$tpl_dir./product-sort.tpl}
   {include file=$tpl_dir./product-list.tpl products=$products}
   {include file=$tpl_dir./pagination.tpl}
{else}

{l s='No products.'}
{/if}



Then you can link a menu button to products.php. I use the Wiznav module. Just by adding a button with a "products.php" link will get the thing to work.

Good luck :)

Link to comment
Share on other sites

  • 2 months later...

I wonder howcome a feature like this was never added to the mainstream version. It's kinda obvious that someone wants to show all products in store. PrestaShop only supports Best Sales, Category shows, NewProducts and the result of a search query fired on the entire product line which I will refer to as SearchResults.

@Jupiterr's:

I tried your code and ended up with just the New Products, not All Products. Ended up writing my own, using your code as a (very decent) guide. I'm not sure if I should share it because in order to get it to work, I had to add two functions to the Product class (/classes/Product.php) and my version is written for 1.3.2. Since it alters a core file, updating might become a bit more troublesome. If you guys think I should share..... imma go and see if the developers wanna add the two functions to the Product class on a permanent basis.

This addon works like a charm and it works similar to Best Sales, Category and New Products and SearchResults. It checks your site's setting of products-per-page and just like SearchResults, uses Pagination to fetch from the database and display on screen only that many products. It's resource efficient. Dunno (yet) if it's 1.4.x compatible.

With regards,
mischaatje

Link to comment
Share on other sites

  • 1 month later...

Hello mischaatje,

i'm looking for exactly the same feature. I'd be very interested if you could share your working script for it or at least give a hint on what to correct based on Jupiterr's script, especially concerning the allproducts.php and the classes to create. I'm on pretsashop 1.3.2.3 so your script should work for me.

Link to comment
Share on other sites

Hello mischaatje,

i'm looking for exactly the same feature. I'd be very interested if you could share your working script for it or at least give a hint on what to correct based on Jupiterr's script, especially concerning the allproducts.php and the classes to create. I'm on pretsashop 1.3.2.3 so your script should work for me.


Jupiterr's script shows all the 'best-sold' products and only the 'best-sold' products. That's because the function he uses from the Product class is designed to do just that. As said before, there is no function available in all of prestashop that would grab from the database any and all products, without conditions (new items, best buys, same category) or filtering (searches). I haven't found it yet, though.

So my script introduces two new functions in the Product class, however I have not yet taken the time to put them into their own class override file (which is required if you wanna update ps). I have a good tutorial source on how to do that, but just not the time to do it. To be continued..... ( hopefully soon )

EDIT: Corrected 'new products' to 'best-sold' products
Link to comment
Share on other sites

  • 1 month later...

The right way (without tags or categories) is to create two new files. I'd call them Products.php and Products.tpl.<br/><br/>1. Upload Products.php with the following code to the root directory (/):<br/><br/>

<br/><?php<br/><br/>include(dirname(__FILE__).'/config/config.inc.php');<br/>include(dirname(__FILE__).'/header.php');<br/><br/>include(dirname(__FILE__).'/product-sort.php');<br/><br/>$nbProducts = intval(Product::getNewProducts(intval($cookie->id_lang), isset($p) ? intval($p) - 1 : NULL, isset($n) ? intval($n) : NULL, true));<br/>include(dirname(__FILE__).'/pagination.php');<br/><br/>$smarty->assign(array(<br/>    'products' => Product::getNewProducts(intval($cookie->id_lang), 0, 10, false, $orderBy, $orderWay),<br/>    'nbProducts' => intval($nbProducts)));<br/><br/>$smarty->display(_PS_THEME_DIR_.'products.tpl');<br/><br/>include(dirname(__FILE__).'/footer.php');<br/><br/>?><br/>

<br/><br/><br/>2. Upload Products.tpl with the following code to your theme's folder (/myshop/themes/prestashop/, for ex.):<br/><br/>

<br/>capture name=path}{l s='Products'}{/capture}<br/>{include file=$tpl_dir./breadcrumb.tpl}<br/><br/><h2>{l s='Products'}</h2><br/><br/>{if $products}<br/>    {include file=$tpl_dir./product-sort.tpl}<br/>    {include file=$tpl_dir./product-list.tpl products=$products}<br/>    {include file=$tpl_dir./pagination.tpl}<br/>{else}<br/>    <p class="warning">{l s='No products.'}</p><br/>{/if}<br/>

<br/><br/>Then you can link a menu button to products.php. I use the Wiznav module. Just by adding a button with a "products.php" link will get the thing to work.<br/><br/>Good luck :)

 

This don't show all products but only new products !!

'Product::getNewProducts'

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

It is RIDICULOUS that admin cannot view a list if all products- even simply to assign them to multiple categories. In the meantime, if you have $200 to spare (!!) you can do this EASILY using Store Commander for PrestaShop (storecommander.com).... Let's hope PrestaShop adds this feature to admin!

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

I agree

it is pretty darn ridiculous there is no way to see all products without clicking through on each product category. Can't even filter by * to get the list. The more I use prestashop the more I see how much it lacks

 

I agreed with you. Showing all product is the basic feature but i have not seen this happen. I have not get this done in v 1.4.4.. :(

Link to comment
Share on other sites

Hey guys! I'm sorry about that.. by then I was starting with Prestashop. It is obviously wrong... like Kolo86 said, I used the getNewProducts function.

 

I will research the planned features for the 1.5 version. This is a basic need and should be a priority part of the upgrade.

 

This guy did a great work here -> http://blog.devcodeit.com/displaying-all-products-in-prestashop/

Link to comment
Share on other sites

  • 3 months later...
  • 2 months later...
  • 7 months later...
  • 1 year later...
  • 1 month later...

Is there a way to make a page for the store front for customers to see all products? This would be convenient for a small store that has only a handful of products.

I am looking for a similar solution.

 

The only way crossed my mind to accomblish such a task is to create an extra top level category where all categories of stoer will list inside it.

eg: Root/Home/MyCatalog/yourcategories...

 

This way in MyCatalog page we can see all products & all categories inside it.

  • Like 1
Link to comment
Share on other sites

  • 6 months later...

Hi

I succeded to make a list of all products, simply by copying the NewProductController.php to AllProductController.php and edit a few places.
in Product.php i copied getNewProducts and renamed it to getAllProducts in Product.php in my override/ folder and removed a few lines of sql (WHERE ... PS_NB_DAYS_NEW_PRODUCT .. )

and in Tools::getPath i added a line in beginning of breadcrumb, that links to all products page

i deleted /cache/class_index.php

in SEO and URLS i added my new friendly url

voila

Edited by michaelhjulskov (see edit history)
  • Like 2
Link to comment
Share on other sites

hello michaelhjulskov,

 

Please could you give a more detailed explanation of the steps, or upload files. I am trying to show all items in a store and activate the navigation facets and I could really know how you did your. thank you very much

Hi

maybe i can help a little...

Its better if you place copies of your files (the related files) on github or gist, so i can maybe edit them or show you how.

and then we can leave it there for others to learn from.

i imagine you have some coding experience

Link to comment
Share on other sites

×
×
  • Create New...