ktross Posted December 9, 2009 Share Posted December 9, 2009 Is there any way to make out of stock products not show up for users? We have thousands of products, and hundreds are out of stock. Any help would be greatly appreciated. Link to comment Share on other sites More sharing options...
freeme Posted December 10, 2009 Share Posted December 10, 2009 Yes there is. Look in the back office under the Preferences and then the Products sub-tab (link). There are a few options on that page for what to do with out of stock products, as well as other things.BTW I just answered this exact same question about 3hrs ago so next time please use the search feature first before asking.F Link to comment Share on other sites More sharing options...
ktross Posted December 10, 2009 Author Share Posted December 10, 2009 Yes there is. Look in the back office under the Preferences and then the Products sub-tab (link). There are a few options on that page for what to do with out of stock products, as well as other things.BTW I just answered this exact same question about 3hrs ago so next time please use the search feature first before asking.F I see no options to hide the products that are not in stock. The only similar one that I see is "Display unavailable product attributes on product page:".Also, I did a few google searches with "site:prestashop.com" and they returned no helpful results. Link to comment Share on other sites More sharing options...
freeme Posted December 10, 2009 Share Posted December 10, 2009 I see no options to hide the products that are not in stock. The only similar one that I see is "Display unavailable product attributes on product page:".Also, I did a few google searches with "site:prestashop.com" and they returned no helpful results. using the search for this forum:http://www.prestashop.com/forums/search_results/14575b87d9f9b973ca1165a94ac70737/One of those results should have what you're looking forf Link to comment Share on other sites More sharing options...
freeme Posted December 10, 2009 Share Posted December 10, 2009 okay so it doesn't allow posting of search results so ignore that link.From the forum's main page use the search bar. Type in hide out of stock product. Press the search button. It turns up a lot of results.F Link to comment Share on other sites More sharing options...
nzrobert Posted December 28, 2009 Share Posted December 28, 2009 Here is where you can change this option. Link to comment Share on other sites More sharing options...
ktross Posted December 28, 2009 Author Share Posted December 28, 2009 Here is where you can change this option. No. That is for unavailable product ATTRIBUTES. Thanks. Link to comment Share on other sites More sharing options...
Duffman Posted December 30, 2009 Share Posted December 30, 2009 I have the same problem as Ktross.There is no such option in Prestashop, this needs to be a custom hack (and it will not be 'clean' it is going to override some stock management parameters from PS).I have found a french post about this here (i'm french): http://www.prestashop.com/forums/viewthread/1894/developpement_et_modules/non_affichage_des_produits_a_stock_0But the code given did not work on my version 1.2.5.I think a lot of people are looking for this hack, so if anyone suceeded, please post the answer. Thanks. Link to comment Share on other sites More sharing options...
nzrobert Posted December 30, 2009 Share Posted December 30, 2009 Edit product-list.tpl and changethis.. > {if isset($products)} <!-- Products list --> </pre> <ul> {foreach from=$products item=product name=products} {if ($product.allow_oosp OR $product.quantity > 0)}{l s='Available'}{else}{l s='Out of stock'}{/if} getImageLink($product.link_rewrite, $product.id_image, 'home')}" alt="{$product.legend|escape:'htmlall':'UTF-8'}" /> {if $product.new == 1}{l s='new'}{/if}{$product.name|truncate:35:'...'|escape:'htmlall':'UTF-8'} {$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'} {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' <= $product.reduction_to && $smarty.now|date_format:'%Y-%m-%d' >= $product.reduction_from))} {l s='Price lowered!'} {/if} {if !$priceDisplay || $priceDisplay == 2}{convertPrice price=$product.price}{if $priceDisplay == 2} {l s='+Tx'}{/if}{/if} {if $priceDisplay}{convertPrice price=$product.price_tax_exc}{if $priceDisplay == 2} {l s='-Tx'}{/if}{/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'} {/foreach} </ul> <br> <!-- /Products list --><br>{/if to this.. > {if isset($products)} <!-- Products list --> </pre> <ul> {foreach from=$products item=product name=products} {if ($product.allow_oosp OR $product.quantity > 0)} getImageLink($product.link_rewrite, $product.id_image, 'home')}" alt="{$product.legend|escape:'htmlall':'UTF-8'}" /> {if $product.new == 1}{l s='new'}{/if}{$product.name|truncate:35:'...'|escape:'htmlall':'UTF-8'} {$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'} {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' <= $product.reduction_to && $smarty.now|date_format:'%Y-%m-%d' >= $product.reduction_from))} {l s='Price lowered!'} {/if} {if !$priceDisplay || $priceDisplay == 2}{convertPrice price=$product.price}{if $priceDisplay == 2} {l s='+Tx'}{/if}{/if} {if $priceDisplay}{convertPrice price=$product.price_tax_exc}{if $priceDisplay == 2} {l s='-Tx'}{/if}{/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'} {else}{/if} {/foreach} </ul> <br> <!-- /Products list --><br>{/if}<br Link to comment Share on other sites More sharing options...
Duffman Posted December 30, 2009 Share Posted December 30, 2009 Hi RobertThanks for your answer. I've just tried it and it seems to be working, but i am having a problem with the product pictures not being diplayed.Originally i had this in my products-list.tpl: getImageLink($product.link_rewrite, $product.id_image, 'home')} and your code replaces it with this: getImageLink($product.link_rewrite, $product.id_image, 'home')}" This causes the pics not to display on firefox or IE. i'm not sure how to fix the code though Also i noticed the product count at the top is not updated, so it could be showing x items while there is none displayed. Link to comment Share on other sites More sharing options...
nzrobert Posted December 30, 2009 Share Posted December 30, 2009 Hey Duffman,Hmm, i dont seem to have any issues with images at all, did the images come up before?I dont see any difference between the code you are providing and the code that i provided..I removed the x products part of the page to simplify the layout, so i guess this doesn't affect me.Not sure i can help with that.Cheers Link to comment Share on other sites More sharing options...
Duffman Posted December 31, 2009 Share Posted December 31, 2009 Hi RobertI managed to fix the image tag.Find below my working product-lis.tpl file: >{if isset($products)} <!-- Products list --> </pre> <ul> {foreach from=$products item=product name=products} {if ($product.allow_oosp OR $product.quantity > 0)} getImageLink($product.link_rewrite, $product.id_image, 'home')}" alt="{$product.legend|escape:'htmlall':'UTF-8'}" /> {if $product.new == 1}{l s='new'}{/if}{$product.name|truncate:35:'...'|escape:'htmlall':'UTF-8'} {$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'} {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' <= $product.reduction_to && $smarty.now|date_format:'%Y-%m-%d' >= $product.reduction_from))} {l s='Price lowered!'} {/if} {if !$priceDisplay || $priceDisplay == 2}{convertPrice price=$product.price}{if $priceDisplay == 2} {l s='+Tx'}{/if}{/if} {if $priceDisplay}{convertPrice price=$product.price_tax_exc}{if $priceDisplay == 2} {l s='-Tx'}{/if}{/if} {l s='View'} {else}{/if} {/foreach} </ul> <br> <!-- /Products list --><br> This code contains two hacks:1) It does not display article where Qty= 02) It does not display the 'Add to Cart' button on the product list page. Link to comment Share on other sites More sharing options...
Duffman Posted December 31, 2009 Share Posted December 31, 2009 Hey Duffman,Hmm, i dont seem to have any issues with images at all, did the images come up before?I dont see any difference between the code you are providing and the code that i provided..I removed the x products part of the page to simplify the layout, so i guess this doesn't affect me.Not sure i can help with that.Cheers yes i figured the two codes i copied in my previous posy were identical but when i try to edit the post to change the code, it don't seem to take the change. Weird.Anyway you can view the code is used in my new post.[EDIT] Damn it changed it in my new post too. See attached pic.Thanks.Antoine Link to comment Share on other sites More sharing options...
nzrobert Posted December 31, 2009 Share Posted December 31, 2009 Good stuff man, looking good. Link to comment Share on other sites More sharing options...
sm3004 Posted February 3, 2010 Share Posted February 3, 2010 I am using a theme so my product-list.tpl looks different than the one mentioned above. Can anyone help me out with the same issue? {$category->name|escape:'htmlall':'UTF-8'} {if $products} {include file=$tpl_dir./product-sort.tpl} {/if} {$HOOK_LEFT_COLUMN} {if isset($products) AND $products} {assign var='liHeight' value=360} {assign var='nbItemsPerLine' value=4} {assign var='nbLi' value=$products|@count} {assign var='nbLines' value=$nbLi/$nbItemsPerLine|ceil} {assign var='ulHeight' value=$nbLines*$liHeight} {foreach from=$products item=product name=products} {assign var='productLink' value=$link->getProductLink($product.id_product, $product.link_rewrite, $product.category)} {$product.name|truncate:30|escape:'htmlall':'UTF-8'}{if $product.new == 1}{l s='new'}{/if} <!-- Original Code {displayWtPrice p=$product.price}{l s='View'} --> <!-- MY NEW CODE --> {if $product.price_without_reduction != $product.price}{displayWtPrice p=$product.price_without_reduction}SALE! {/if}{displayWtPrice p=$product.price}{l s='View'} <!-- {l s='Cart'}--> {/foreach} {else} {l s='No featured products' mod='homefeatured'} {/if} <!-- Pagination --> {include file=$tpl_dir./pagination.tpl} <!-- /MODULE Home Featured Products --> Link to comment Share on other sites More sharing options...
ROUGHY Posted September 6, 2010 Share Posted September 6, 2010 Anyone got a solution? I have the same picture-problem as Duffman... Link to comment Share on other sites More sharing options...
grolarja Posted December 12, 2011 Share Posted December 12, 2011 removed Link to comment Share on other sites More sharing options...
grolarja Posted December 13, 2011 Share Posted December 13, 2011 yes i figured the two codes i copied in my previous posy were identical but when i try to edit the post to change the code, it don't seem to take the change. Weird. Anyway you can view the <img /> code is used in my new post. [EDIT] Damn it changed it in my new post too. See attached pic. Thanks. Antoine Duffman, How can we update this code that it also works when you have two or more attibutes in the product that still have stock. With the code above the product dissapears when the leading attribute has no stock. But also dissapears when an extra attribute (not leading) still has stock. Can you please help. grolarja 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