Jump to content

Hide french-only products and categories when user is browsing English site


Recommended Posts

Hello!

I am using Prestashop 1.3.6.0 (my client's template is not working with 1.4).

I have about 800 products, but only 50-100 of them are available in English language, but all of them are available in French.

I don't want users to see the french products at all when they browse the english version of the site.

Right now, all the products which have no translation are still appearing in their respective category, with no name and no description.

I want Prestashop to automatically hide these instead of showing that.

Any way to get this done at all?

Thanks a lot!

Link to comment
Share on other sites

I think the only way to do this is to change the core files that display the products, or maybe change the template files.
for example you can change the product-list.tpl in your theme folder :

Add this code :

{if $lang_iso == "fr"}

{foreach ...........
Here goes the original code
{/foreach ..........

{/if}




that should do it.

ys

Link to comment
Share on other sites

Wow, thanks!

This did the trick!

However I included an attachment with an issue that remains...

The front-office still seems to believe that there are products on the page even though there isn't anything.

It says "There are 23 products in this category", but that's not the right amount of english products.

The navigation claims there are 6 pages, but there really shouldn't be that many and it results in empty pages.

It's already a lot better than it was and I can probably work out something from this point, but if you know how I can make it better, let me know! :)

45070_tvUVNFPExTo8n75Nq3WU_t

Link to comment
Share on other sites

Yes, my code example just hides the products. But the database obviously still has them. And the template includes them also in these messages.
In my own themes i have deleted these kind of messages (like there are xxx products). I dont see the added value of them to my visitors.
And the pagination below is a totally different kind of beast. That takes on some serious programming to overcome.

Link to comment
Share on other sites

  • 3 weeks later...

I have another issue now.

It seems like even products with an english translation are missing from the product list!

When I switch to English on my site, all the categories are empty!

Is my product_list.tpl missing something?


{if isset($products)}
<!-- Products list -->

<!-- /Products list -->
{/if}
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...