No announcement yet.

Add text based on payment method

  • Filter
  • Time
  • Show
Clear All
new posts

  • Add text based on payment method

    I'm running my head against a wall right now. I need to add some text to the invoice based on what payment method is chosen. I can't seem to figure out how to get the javascript to show. I'm sure I'm missing something simple.

    Basically what I need is if the customer pays by Purchase Order, they need to be told where to remit the payment. The following code is not outputting anything.

    HTML Code:
    <script>var paymenttype=[opaymethod]; if(paymenttype== "Purchase Order") { document.write("<div class="send-invoice"><p>Please remit payment to: Marco Industries DBA Flying Skull Plant Products, 9220 SE Stark St, Portland, OR 97216</p></div><div class="clear"></div>");}</script>

  • #2
    Hi, I can see that this is an old post... but did you ever get this to work? It's exactly the solution I need for our invoices!


    • #3
      Nope. I ended up putting the remit statement on *ALL* invoices and hope for the best.


      • #4
        Got it working! I ran the script using the developer console in Safari and found that the double quotation marks in the html needed to be changed to single quotation marks. Also, quotations needed to be added around [opaymethod] where the variable is set. Here's the code that's working for me:

        HTML Code:
        <script type="text/javascript">
            var paymenttype='[opaymethod]';
            if(paymenttype=='|3dcart|Pay by Check - For Staff Use Only') 
                { document.write("<div><p style='margin-top:15px;'>Your check for [total] is due within 30 days of order shipment.</p></div><div class='clear'></div>");}