Jump to content

Template Sytex


superman16

Recommended Posts

Im having issues with the following code

 

{if $product.status eq 'Active'}
<button type="submit" class="btn btn-info btn-sm">Login to Control Panel</button> 
{else}
<p>No active login functions, please contact support</p>
{/if}

 

Dispite if the product/service has a status of Active or other, it still displays:

 

<p>No active login functions, please contact support</p>

 

What i want it to do is show the submit button if the product status is 'Active' else just display the above text.

 

Can anyone help me with this one?

Edited by superman16
Link to comment
Share on other sites

Great that worked thanks!

 

Now i would like to extend on it slightly

 

{if $status eq 'Active'}
<button type="submit" class="btn btn-info btn-sm">Login to Control Panel</button>{else}
{if $status eq 'Pending'}
<div class="alert alert-info"Your order is still pending for review. Please contact support if you have any questions.</div>{else}
{if $status eq 'Suspended'}
<div class="alert alert-error">No active login functions, Your service is currently suspended. Please contact support</div>
{/if}

Link to comment
Share on other sites

the above should work (apart from the missing >), though personally i'd change it to use elseif...

 

{if $status eq 'Active'}
   <button type="submit" class="btn btn-info btn-sm">Login to Control Panel</button>
{elseif $status eq 'Pending'}
   <div class="alert alert-info">Your order is still pending for review. Please contact support if you have any questions.</div>
{elseif $status eq 'Suspended'}
   <div class="alert alert-error">No active login functions, Your service is currently suspended. Please contact support</div>
{/if}

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