FabelleCZ Posted December 5, 2013 Share Posted December 5, 2013 Hello, I have several problems with my Prestashop template (or maybe it's a general Prestashop problem): 1. There are some empty spaces (instead of products) in product categories. It's always at the end of the site so it seems like there are no more products in the category, although they are. See the attachment 'Products missing'. 2. I quess my second problem in connected to the first one - the site searching does not work how it should. It does not display all found results. Please see the attachments 'site search'. I the 'hidden' product from the first and the second problem are the same...Could you please tell me where could be the problem? Thanks for any advices! Ondrej My site: www.fabelle.cz Link to comment Share on other sites More sharing options...
ibndawood Posted December 6, 2013 Share Posted December 6, 2013 Hi Ondrej, Your problem can be fixed here : 1. Your theme displays about 5 products in 1 row so please go to Product->Preferences and give it a number that is a multiple of 5. https://www.diigo.com/item/image/4h50p/g3uv 2. You need to add the missing products to index. Like here : https://www.diigo.com/item/image/4h50p/g0e4 Once you add those missing products to index you will be able to view those products in search results. Link to comment Share on other sites More sharing options...
vekia Posted December 6, 2013 Share Posted December 6, 2013 1) but there sometimes is one "blank" row, sometimes two "blank" product rows. i suppose that problem is somewhere else. Have you got in product-list.tpl file some if conditions to display / hide for example out of stock products? 2) the same as above, search results uses product-list.tpl too Link to comment Share on other sites More sharing options...
FabelleCZ Posted December 6, 2013 Author Share Posted December 6, 2013 Hi, yes, we should have this type of conditions for hiding products out of stock. Someone else did it for us because we are not familiar with these kind of things. I tried to attach the whole product-list.tpl file but it's not permitted so I checked the file and I found this: {if isset($products)} <!-- Products list --> <ul id="product_list" class="clear"> {foreach from=$products item=product name=products} {if $product.quantity > 0} <li class="ajax_block_product {if $smarty.foreach.products.first}first_item{elseif $smarty.foreach.products.last}last_item{/if} {if $smarty.foreach.products.index % 2}alternate_item{else}item{/if} "> Is it what you meant? Link to comment Share on other sites More sharing options...
vekia Posted December 6, 2013 Share Posted December 6, 2013 that's right. this causing these "empty" product rows in search results and in category product listings too Link to comment Share on other sites More sharing options...
stottycabanas Posted December 7, 2013 Share Posted December 7, 2013 Hmmm, it seems strange that the blanks are always the last product or products on a page. Is there a reason for that, Milos? Link to comment Share on other sites More sharing options...
FabelleCZ Posted December 7, 2013 Author Share Posted December 7, 2013 Is there any chance I can solve this problem and still have this kind of conditions for hiding products out of stock? Link to comment Share on other sites More sharing options...
vekia Posted December 7, 2013 Share Posted December 7, 2013 Hmmm, it seems strange that the blanks are always the last product or products on a page. Is there a reason for that, Milos? these "blank" fields aren't for last products, it's just a arrange of <li> items. Is there any chance I can solve this problem and still have this kind of conditions for hiding products out of stock? you have to change sql query, remove these if conditions - it's not useful. then in category class, in function getProducts add if condition: where p.quantity >0 Link to comment Share on other sites More sharing options...
FabelleCZ Posted January 4, 2014 Author Share Posted January 4, 2014 these "blank" fields aren't for last products, it's just a arrange of <li> items. you have to change sql query, remove these if conditions - it's not useful. then in category class, in function getProducts add if condition: where p.quantity >0 Could you please tell me what exactly (and where) should I change? How I said, somebody else did this change for us and I'm a very beginner at these things... There's no need to reserve the function for hiding 0 quantity products, we solved this somehow else. The main thing now is to disable this condition and solve this 'strange hiding products' problem. Thanks! Link to comment Share on other sites More sharing options...
vekia Posted January 4, 2014 Share Posted January 4, 2014 for the first you have to remove {if} condition from template file {if $product.quantity > 0} code here {/if} remove if condition (keep code inside if condition). Link to comment Share on other sites More sharing options...
FabelleCZ Posted January 6, 2014 Author Share Posted January 6, 2014 for the first you have to remove {if} condition from template file {if $product.quantity > 0} code here {/if} remove if condition (keep code inside if condition). Thanks for the advice! I tried that and now all products seem to display in the category... Link to comment Share on other sites More sharing options...
vekia Posted January 7, 2014 Share Posted January 7, 2014 "blank" fields were removed, but... this is what you expect exactly? Link to comment Share on other sites More sharing options...
FabelleCZ Posted January 7, 2014 Author Share Posted January 7, 2014 "blank" fields were removed, but... this is what you expect exactly? Yes, it is. We don't need this condition anymore, we solved it other way - the zero products automatically turns off within a product import through XML file... So the only problem was this strange hiding products in categories and site search. Now everything seems to be working as it should. Thanks once more . Link to comment Share on other sites More sharing options...
Recommended Posts