AffordableDomainsCanada Posted February 1, 2017 Share Posted February 1, 2017 I am looking for something like such, but I am not sure how to make it display an out of stock button if the stock control is set to 0 ? {if $product.id=1 == out of stock} <a href="/cart.php?a=add&pid=432" class="btn btn-danger"><i class="fa fa-shopping-cart"> </i> {$LANG.outofstock} </a</td> {/else} <a href="/cart.php?a=add&pid=432" class="btn btn-success"><i class="fa fa-shopping-cart"> </i> {$LANG.ordernowbutton} </a</td> {/if} 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 1, 2017 Share Posted February 1, 2017 https://forum.whmcs.com/showthread.php?107179-Sold-Out-Button&p=500966#post500966 0 Quote Link to comment Share on other sites More sharing options...
AffordableDomainsCanada Posted February 1, 2017 Author Share Posted February 1, 2017 https://forum.whmcs.com/showthread.php?107179-Sold-Out-Button&p=500966#post500966 Is that not for a Cart Template ? This is for a page I created.. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 1, 2017 Share Posted February 1, 2017 Is that not for a Cart Template ? yes - only the cart would have automatic access to stock level variables!. and your example code does mention the cart. This is for a page I created.. aaah.. you never mentioned that... it would have been useful information if this is another WHMCS page, then you're looking at an action hook to query the db to get the stock level for the product in question and pass it back to the template... or maybe even a feed that will do the same query but give you a specific output based on the result. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.