Jump to content

Order now button >Out of Stock button


Recommended Posts

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}

Link to comment
Share on other sites

Is that not for a Cart Template ?

yes - only the cart would have automatic access to stock level variables!. :idea:

 

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 :roll:

 

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated