flash_os Posted November 12, 2009 Share Posted November 12, 2009 How to hide "Availability: X items in stock" in product page from user? Link to comment Share on other sites More sharing options...
rocky Posted November 13, 2009 Share Posted November 13, 2009 {* Comment out *} the following section of product.tpl in your theme's directory: <!-- availability --> quantity == 0 && !$product->available_later) || (!$product->available_now && $display_qties != 1) } style="display:none;"{/if}> {l s='Availability:'} quantity == 0} class="warning-inline"{/if}> {if $product->quantity == 0}{if $allow_oosp}{$product->available_later}{else}{l s='This product is no longer in stock'}{/if}{else}{$product->available_now}{/if} Link to comment Share on other sites More sharing options...
flash_os Posted November 13, 2009 Author Share Posted November 13, 2009 Thanks, word: "Availability:" now hidden.But I still can see: "X items in stock". Link to comment Share on other sites More sharing options...
flash_os Posted November 13, 2009 Author Share Posted November 13, 2009 I got it.I also commented next paragraph.So, the final state should be: <!-- availability quantity == 0 && !$product->available_later) || (!$product->available_now && $display_qties != 1) } style="display:none;"{/if}> {l s='Availability:'} quantity == 0} class="warning-inline"{/if}> {if $product->quantity == 0}{if $allow_oosp}{$product->available_later}{else}{l s='This product is no longer in stock'}{/if}{else}{$product->available_now}{/if} --> <!-- number of item in stock quantity == 0)} style="display:none;"{/if}> {$product->quantity|intval} quantity > 1} style="display:none;"{/if} id="quantityAvailableTxt">{l s='item in stock'} quantity < 2} style="display:none;"{/if} id="quantityAvailableTxtMultiple">{l s='items in stock'} --> Thanks again. Link to comment Share on other sites More sharing options...
andrew Posted November 13, 2009 Share Posted November 13, 2009 Or you could in the back office go to:PreferencesProduct settingsDisplay available quantities on product pageand change to no- Andrew Link to comment Share on other sites More sharing options...
flash_os Posted November 13, 2009 Author Share Posted November 13, 2009 Thank you, andrew! Link to comment Share on other sites More sharing options...
brisa Posted November 23, 2009 Share Posted November 23, 2009 HiI tried to comment out the bit that rocky said and uploaded it and now i'm getting: Fatal error: Smarty error: [in /usr/local/pem/vhosts/109861/webspace/httpdocs/boogtique/store/themes/ipnotik/product.tpl line 214]: syntax error: invalid attribute name: '*' (Smarty_Compiler.class.php, line 1550) in /usr/local/pem/vhosts/109861/webspace/httpdocs/boogtique/store/tools/smarty/Smarty.class.php on line 1095 I have uncommented it and i still get it!The store has to go live in the next few days!!!!!!Heeelp! Link to comment Share on other sites More sharing options...
rocky Posted November 24, 2009 Share Posted November 24, 2009 The error message says to check line 214 of themes/ipnotik/product.tpl. Look for any * on this line, which is causing the problem. If you can't figure out the problem, just replace that line or file with the one from the original ipnotik theme. Link to comment Share on other sites More sharing options...
brisa Posted November 25, 2009 Share Posted November 25, 2009 I have deleted that then i get an error saying that 'nbImages' is a syntax error.I assume becuase its part of an equation:{math equation="width * nbImages>I only want to remove the number of items in stock... Link to comment Share on other sites More sharing options...
joe_french Posted November 26, 2009 Share Posted November 26, 2009 Hi,i m trying to get my shop to display the following:x=number of items leftif x>10 => display "Item available"if 0 display "Only x Items left"if x = 0 => display "Item not available" Link to comment Share on other sites More sharing options...
joe_french Posted November 29, 2009 Share Posted November 29, 2009 UpAnyone on this? Link to comment Share on other sites More sharing options...
rocky Posted November 29, 2009 Share Posted November 29, 2009 Replace lines 271-273 of product.tpl with: {if $product->quantity <= 0}{l s='Item not available'}{elseif $product->quantity < 10}{l s='Only'} {$product->quantity} {l s='items left'} {else}{l s='Item available'}{/if} Link to comment Share on other sites More sharing options...
rudd Posted February 17, 2010 Share Posted February 17, 2010 Replace lines 271-273 of product.tpl with: {if $product->quantity <= 0}{l s='Item not available'}{elseif $product->quantity < 10}{l s='Only'} {$product->quantity} {l s='items left'} {else}{l s='Item available'}{/if} Hi Rocky,With all the changes that one does to the code as suggested above for this example, my questions is:- How does if get affected when you upgrade say from 1.2.5 to 1.3?- Do you have to keep track of these changes and make the changes again once you upgrade or does the upgrade process track and make changes for you if any of this code is to be overwritten?++++++++++ALSO second of the question,Why would one change code when some of these things can be done through back office, specially for a newbie like me. I would rather not touch the code too much if I can avoid it? Link to comment Share on other sites More sharing options...
rocky Posted February 18, 2010 Share Posted February 18, 2010 You must keep track of all the changes you do, since overwriting your modified v1.2.5 files with the v1.3 files will overwrite the changes you made. You will have to make those changes once again after installing v1.3.It is better to do things through the Back Office than to modify code. If you can find a way to do something through the Back Office, then do that. Unfortunately, there are many things that can't be done through the Back Office and so require code changes. Link to comment Share on other sites More sharing options...
cj Posted March 23, 2010 Share Posted March 23, 2010 I am also having problems with removing the Availability display. I have gone into the Preferences/Products and checked No for Display available quantities but it continues to display in all browsers. I am using the Uppercase theme. Link to comment Share on other sites More sharing options...
RickyKidd Posted July 20, 2014 Share Posted July 20, 2014 Thanks, Andrew! Or you could in the back office go to:PreferencesProduct settingsDisplay available quantities on product pageand change to no- Andrew 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