Jump to content

Display different contents according to invoice payment status


howardroark

Recommended Posts

Hello,

 

I'm trying to modify the file complete.tpl so that:

_ If the invoice is paid, my custom "thank you message" will be shown (1).

_ If the invoice is not paid, another custom message instructing user to go to invoice page will be shown (2).

 

Here is my code:

 

----------------------------------------

<link rel="stylesheet" type="text/css" href="templates/orderforms/{$carttpl}/style.css" />

 

<!-- (1) If the order is fully paid -->

{if $ispaid}

<div id="order-boxes">

<p>My "thank you" message.</p>

</div>

 

<!-- (2) If the order is not fully paid -->

{else}

<div id="order-boxes">

<p>My instruction</p>

<p align="center"><a href="viewinvoice.php?id={$invoiceid}" target="_blank">{$LANG.gotoinvoice} {$invoiceid}</a></p>

</div>

 

{/if}

----------------------------------------------------

 

 

I have carefully reviewed and found no problem in this code. However, the code behaves very strangely:

_ Even if the invoice is paid (It's status in WHMCS --> Billing --> Invoices is "Paid"), (2) is ALWAYS shown FIRST when the browser returns to the Complete Page (cart.php?a=complete). (2) is shown even when I press F5 several times.

_ After (2) is shown, I open the invoice link (viewinvoice.php?id=xxxx), and is immediately redirected to the Complete Page again, this time (1) is shown!

_ From this point, pressing F5 on the Complete Page will always lead to (1).

 

Please help me solve this problem.

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