matduke Posted May 12, 2011 Share Posted May 12, 2011 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 More sharing options...
uddhava Posted May 12, 2011 Share Posted May 12, 2011 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 More sharing options...
matduke Posted May 12, 2011 Author Share Posted May 12, 2011 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! Link to comment Share on other sites More sharing options...
uddhava Posted May 12, 2011 Share Posted May 12, 2011 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 More sharing options...
matduke Posted June 1, 2011 Author Share Posted June 1, 2011 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 --> {if $lang_iso == "fr"} {foreach from=$products item=product name=products} getImageLink($product.link_rewrite, $product.id_image, 'home')}" alt="{$product.legend|escape:'htmlall':'UTF-8'}" /> {if $product.on_sale}{l s='On sale!'}{elseif ($product.reduction_price != 0 || $product.reduction_percent != 0) && ($product.reduction_from == $product.reduction_to OR ($smarty.now|date_format:'%Y-%m-%d %H:%M:%S' <= $product.reduction_to && $smarty.now|date_format:'%Y-%m-%d %H:%M:%S' >= $product.reduction_from))}{l s='Price lowered!'}{/if}{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if} {if $product.new == 1}{l s='new'}{/if}{if ($product.allow_oosp OR $product.quantity > 0)}{l s='Available'}{else}{l s='Out of stock'}{/if} {if ($product.allow_oosp OR $product.quantity > 0) && $product.customizable != 2}{l s='Add to cart'} {else}{l s='Add to cart'} {/if}{l s='View'} {$product.name|truncate:40:'...'|escape:'htmlall':'UTF-8'} {$product.description_short|truncate:200:'...'|strip_tags:'UTF-8'} {/foreach} {/if} <!-- /Products list -->{/if} Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now