Jump to content

{SOLVED} Main Category Says: There Are No Products.


Recommended Posts

I use mostly sub-categories for my products, like this: Books is the "main category" and the different types of books are sub-categories.

On the "Books" page I do a general description of the types of books, and the sub-categories are shown below.

But, at the top, where "Books" is shown, below the "breadcrumb" it says "There are no products." How do I get that to go away.

With the way the search works on here now, I cannot find anything related to this ! LOL

 

Therearenoproducts.jpg

 

Thanks in advance !

Kathleen

Link to comment
Share on other sites

I use mostly sub-categories for my products, like this: Books is the "main category" and the different types of books are sub-categories.

On the "Books" page I do a general description of the types of books, and the sub-categories are shown below.

But, at the top, where "Books" is shown, below the "breadcrumb" it says "There are no products." How do I get that to go away.

With the way the search works on here now, I cannot find anything related to this ! LOL

 

Therearenoproducts.jpg

 

Thanks in advance !

Kathleen

 

 

Try this

http://www.prestashop.com/forums/topic/86803-solved-there-are-no-products/

 

Everyone has this problem.Is a bug.

Link to comment
Share on other sites

Try this

http://www.prestashop.com/forums/topic/86803-solved-there-are-no-products/

 

Everyone has this problem.Is a bug.

 

 

I'm using 1.4.4 and the code has changed to this:

 

{if isset($category)}
{if $category->id AND $category->active}
	<h1>{strip}
		{$category->name|escape:'htmlall':'UTF-8'}
		<span>
			[color="#FF0000"]{if $category->id == 1 [/color]OR $nb_products == 0}{l s='There are no products'}
			{else}
				{if $nb_products == 1}{l s='There is'}{else}{l s='There are'}{/if} 
				{$nb_products} 
				{if $nb_products == 1}{l s='product.'}{else}{l s='products.'}{/if}
			{/if}

 

Should I insert my category ID numbers in there where the {if $category->id == 1 is ? :unsure: If I have 2, separate them by a comma ?

Link to comment
Share on other sites

BTW, I don't think it's a bug, probably meant to be this way.

For me, it works just fine, I just list all items in a sub category ALSO in their parent category.

So my customers can browse all books in English or browse eg only Fiction books in English by going to the Fiction sub category.

Still, I understand if not everybody wants it that way. Maybe they'll make it configurable in the future...

 

/Mats

Link to comment
Share on other sites

You could use the translation in the BO and translate "There are no products" to eg "There are plenty of products, please click on a sub category to see them" :-)

 

/Mats

 

Ahaha yeah good idea.

 

But i say to kathleen, you know what i do, i just removed that line from the code.So it does not show that line at all in categories.I dont suggest you change any other things, can create other problems.

 

{if isset($category)}
{if $category->id AND $category->active}
	<h1>{strip}
		{$category->name|escape:'htmlall':'UTF-8'}
		<span>
			{if $category->id == 1 OR $nb_products == 0}{l s='here i deleted this line is empty'}
			{else}
				{if $nb_products == 1}{l s='There is'}{else}{l s='There are'}{/if} 
				{$nb_products} 
				{if $nb_products == 1}{l s='product.'}{else}{l s='products.'}{/if}
			{/if}
		</span>{/strip}
	</h1>

 

Solves perfectly the problem and does not affect number of products in subcategory.you can test and see if all is fine.

 

Or you can try mohsart's idea, is simpler and no risk to code.

Link to comment
Share on other sites

This is a not a bug, it's the way Prestashop was designed.

 

You have the option to assign a product to multiple categories (IE in category A, and in a subcategory B).

 

This is not done automatically, since some people may not want to display it automatically in both categories.

Link to comment
Share on other sites

This is a not a bug, it's the way Prestashop was designed.

 

You have the option to assign a product to multiple categories (IE in category A, and in a subcategory B).

 

This is not done automatically, since some people may not want to display it automatically in both categories.

 

Why is it a bug? Because of the statement there are '0' products which is incorrect and misleading.Minor bug with the wording that is.Or maybe prestashop cant calculate inside the subcategories yet? Unless you actually enter the sub category.

Link to comment
Share on other sites

It says there are no products [in this category, but may be in others], which may or may not be misleading.

 

Say that you sell shelves.

You have three top categories: Homes, Garages, and Offices.

Would it make sense to have it say "there are 10 products" in the Garages category? Maybe, or maybe THAT would be misleading and imply that there are 10 garages in stock?

What it you sell garages as well, and have two of them in the Garages category?

 

Anyways, if the developers says "no it's supposed to be that way" you may think they are stupid but you'll have to accept that it's not a bug and that this is how it's at, and learn to find a way around it.

 

/Mats

Link to comment
Share on other sites

It says there are no products [in this category, but may be in others], which may or may not be misleading.

 

Say that you sell shelves.

You have three top categories: Homes, Garages, and Offices.

Would it make sense to have it say "there are 10 products" in the Garages category? Maybe, or maybe THAT would be misleading and imply that there are 10 garages in stock?

What it you sell garages as well, and have two of them in the Garages category?

 

Anyways, if the developers says "no it's supposed to be that way" you may think they are stupid but you'll have to accept that it's not a bug and that this is how it's at, and learn to find a way around it.

 

/Mats

 

No point in argueing about this.Hope the original poster got what she wanted.Its good to play with words like what you stated now,but you cannot play with a number.Zero is a finite value.

 

If i have some products in sub categories it should NOT say zero products.BUt like you said , if a user has many sub cats, it will be a very long line.So is my opinion to not mention it at all.Or like you suggested, it can be changed in translations to more sensible.

Though a minor issue,for me it is a bug.That has nothing to do with anyone being stupid.I dont know why you feel that way.

Link to comment
Share on other sites

Well, what I did was use indus's suggestion & combined it with mohsart's suggestion. I changed " There are no products" to "We have many to choose from".

I saved a copy of my category.tpl file on my hard drive, (I do this with all files I change, this way when I upgrade, I can reference what I changed & replicate it).

Thanks for all the help.

 

(mohsart, I would've changed the translation, but I get the following error when I try to access the module translation section:

> Warning, your hosting provider is using the suhosin patch for PHP, which

> limits the maximum number of fields to post in a form:

> 1000 for suhosin.post.max_vars.

> 1000 for suhosin.request.max_vars.

> Please ask your hosting provider to increase the suhosin post and request

> limit to 4450 at least.

 

I contacted my hosting service & they said I would need to do a custom PHP install. What a bunch of crap. I've never had any other issues with them like upload size etc... Oh well, I just have to code my changes :angry: )

 

Thanks again everyone ! This forum ROCKS !!

Kathleen

Link to comment
Share on other sites

Well, what I did was use indus's suggestion & combined it with mohsart's suggestion. I changed " There are no products" to "We have many to choose from".

I saved a copy of my category.tpl file on my hard drive, (I do this with all files I change, this way when I upgrade, I can reference what I changed & replicate it).

Thanks for all the help.

 

(mohsart, I would've changed the translation, but I get the following error when I try to access the module translation section:

> Warning, your hosting provider is using the suhosin patch for PHP, which

> limits the maximum number of fields to post in a form:

> 1000 for suhosin.post.max_vars.

> 1000 for suhosin.request.max_vars.

> Please ask your hosting provider to increase the suhosin post and request

> limit to 4450 at least.

 

I contacted my hosting service & they said I would need to do a custom PHP install. What a bunch of crap. I've never had any other issues with them like upload size etc... Oh well, I just have to code my changes :angry: )

 

Thanks again everyone ! This forum ROCKS !!

Kathleen

 

 

Well, after going through this thread and reading mozhart's suggestions/comments and some introspection, i actually changed all my products to also be in my main categories along with the sub categories.

 

Seems better this way and is one click less for the customer.Works great with the layered navigation block.Very useful.

 

:)

Link to comment
Share on other sites

Glad to have been of some help.

Bewitching: I hope you can stay with English as the shops only language if you cannot use the translation!

Apart from that, if the issue is solved, could you please edit the subject of the first post and add [sOLVED] to it, thanks.

 

/Mats

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...