Offline.HTML

Discussion in 'Troubleshooting' started by moonwalker, Oct 13, 2010.

  1. moonwalker

    moonwalker aMember Pro Customer

    Joined:
    Aug 21, 2010
    Messages:
    52
    Hi,

    How do I edit Offline.html? All I see is this:
    Code:
    #_PLUG_PAY_OFFLINE_HTML_HEAD# (plugins/payment/offline/offline.html) 
    #_PLUG_PAY_OFFLINE_HTML_HEAD2#
    
    #_PLUG_PAY_OFFLINE_HTML_PUSR#{$payment.payment_id}/{$member.login}
    #_PLUG_PAY_OFFLINE_HTML_PRICE#{$price}
    
    #_PLUG_PAY_OFFLINE_HTML_TEXT1#
    #_PLUG_PAY_OFFLINE_HTML_TEXT2#
    #_PLUG_PAY_OFFLINE_HTML_TEXT3#
    #_PLUG_PAY_OFFLINE_HTML_TEXT4#
    
    #_PLUG_PAY_OFFLINE_HTML_TEXT5#
    #_PLUG_PAY_OFFLINE_HTML_TEXT6#
    #_PLUG_PAY_OFFLINE_HTML_TEXT7#
    
    
    I don't know where to start or where to change the text displayed.

    And is there a way I can add CSS to the file?

    Thanks.
  2. moonwalker

    moonwalker aMember Pro Customer

    Joined:
    Aug 21, 2010
    Messages:
    52
    Ok I found out that I can change the text in the language files, but I don't think this is a good idea. What happens when I update the package? All my text will be overwritten.

    Any ideas are much appreciated.
  3. moonwalker

    moonwalker aMember Pro Customer

    Joined:
    Aug 21, 2010
    Messages:
    52
    I already figured it out.

    Just one last question:
    Is there anyway to catch the membership name? Not the id, but the name of it.

    Thanks.
  4. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    If you mean product title you can use {$product.title} variable.
  5. moonwalker

    moonwalker aMember Pro Customer

    Joined:
    Aug 21, 2010
    Messages:
    52
    Thanks Alexander. That's what I was looking for!

    Off topic question:
    Is there any place where we can put our requests for the next update? I'm mostly concerned about the passwords being added to the database in plain text.
  6. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    It is already fixed in development version (aka v.4). Unfortunately, it is not realistic to fix it in v.3 - a lot of existing staff will be broken.
  7. moonwalker

    moonwalker aMember Pro Customer

    Joined:
    Aug 21, 2010
    Messages:
    52
    Thank you Alex. Can you also please take a look at my submitted ticket in the help desk?

    Thanks a lot.
  8. kodiwolf

    kodiwolf aMember Pro Customer

    Joined:
    Jul 9, 2008
    Messages:
    13
    I tried this, but when more than one product is ordered, it only shows the first one. Is there some way to make it list all the products in the order?

    The reason I ask is that I would like the offline.html page to be a kind of billing invoice that my customers can print out and mail a copy of with their payment. It would also be nice if it were possible to break up the individual prices for each product to be listed with each product, and then have the total at the bottom, instead of only having the total as {$price}.

    As it is now, when someone orders more than one product, only the first product is shown, but then the total price for all the products ordered is listed, making it look like the combined price is just for the first product.

    Otherwise, my next question is how can I get the info that's sent in the payment receipt e-mail (that's only sent after payment has been completed) to be included in the pending payment e-mail, so it can act as a billing invoice?

    I'd appreciate any help on this.

    Kodi
  9. skippybosco

    skippybosco CGI-Central Partner Staff Member

    Joined:
    Aug 22, 2006
    Messages:
    2,526
  10. kodiwolf

    kodiwolf aMember Pro Customer

    Joined:
    Jul 9, 2008
    Messages:
    13
    Okay, I think I figured it out for myself. It's not necessarily perfect, but it seems to work for the most part.

    I just copied the fields used in the receipt e-mail to the pending payment e-mail (minus the one that lists the date the payment was completed, since I didn't think it would work because the payment won't have been completed yet).

    Code:
    Your order details are below:
    
    Invoice Number {$payment.payment_id}
    
    {"Product/Subscription Title"|string_format:"%-50s"} Price
    -----------------------------------------------------------
    {foreach from=$products item=p}
    {$p.title|string_format:"%-50s"} {$config.currency|default:"$"}{$p.price}
    {/foreach}
    -----------------------------------------------------------
    {"Subtotal"|string_format:"%-50s"} {$config.currency|default:"$"}{$subtotal|string_format:"%.2f"}
    {if $payment.data.COUPON_DISCOUNT ne "" }
    {"Discount"|string_format:"%-50s"} {$config.currency|default:"$"}{$payment.data.COUPON_DISCOUNT|string_format:"%.2f"}
    {/if}
    {if $payment.data.TAX_AMOUNT ne ""}
    {"Tax Amount"|string_format:"%-50s"} {$config.currency|default:"$"}{$payment.data.TAX_AMOUNT|string_format:"%.2f"}
    {/if}
    -----------------------------------------------------------
    {"Total"|string_format:"%-50s"} {$config.currency|default:"$"}{$total|string_format:"%.2f"}
    The above code formats out to this for me:

    Code:
    Your order details are below:
    
    Invoice Number 28
    
    Product/Subscription Title                         Price
    -----------------------------------------------------------
    Item 1                                             $10
    Item 2                                             $10
    Item 3                                             $10
    -----------------------------------------------------------
    Subtotal                                           $0.00
    -----------------------------------------------------------
    Total                                              $30.00
    The only thing that seems to be off is that the prices used for the items show up as $10, instead of $10.00, while the Subtotal and Total show up with the '.00' at the end.

    I'm not sure why it's doing that, since when I go in and mark the payment as paid, the payment receipt e-mail, which is using the same code, shows the item prices as $10.00, not $10.

    Code:
    Invoice Number 28 from 01/12/2011
    
    Product/Subscription Title                         Price
    -----------------------------------------------------------
    Item 1                                             $10.00
    Item 2                                             $10.00
    Item 3                                             $10.00
    -----------------------------------------------------------
    Subtotal                                           $30.00
    -----------------------------------------------------------
    Total                                              $30.00

    Anyway, I can work with this. Hope it helps someone else.

    If anyone has any ideas on why the decimal places aren't showing up, I'd be interested in a fix.

    Take care,

    Kodi
  11. kodiwolf

    kodiwolf aMember Pro Customer

    Joined:
    Jul 9, 2008
    Messages:
    13
    I'm apparently blind, as I only just noticed the Subtotal is showing as $0.00, but only in the Pending e-mail. I guess I missed it because the Total is showing correctly.

    Any ideas?

    For now, I think I'm just going to delete the Subtotal line, since it's not really necessary (I don't collect taxes to be added to the Total). I'm just not sure how the coupon thing will display, since I haven't tried placing any orders with one.

    Later,

    Kodi
  12. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    In that template code change {$p.price} to {$p.price|string_format:"%.2f"} it will be formatted correctly.
    In regards to Subtotal it just didn't set for pending emails. If you need it contact me in helpdesk I will modify function that send pending email.
  13. kodiwolf

    kodiwolf aMember Pro Customer

    Joined:
    Jul 9, 2008
    Messages:
    13
    This is what I finally came up with:

    Code:
    Your order details are below:
    
    Invoice Number #{$payment.payment_id}
    
    {"Product/Subscription Title"|string_format:"%-50s"} Price
    -----------------------------------------------------------
    {foreach from=$products item=p}
    {$p.title|string_format:"%-50s"} {$config.currency|default:"$"}{$p.price|string_format:"%.2f"}
    {/foreach}
    -----------------------------------------------------------
    {"Total"|string_format:"%-50s"} {$config.currency|default:"$"}{$total|string_format:"%.2f"}
    
    
    {if $payment.data.COUPON_DISCOUNT ne "" }
    With your coupon you saved:
    -----------------------------------------------------------
    {"Discount"|string_format:"%-50s"} {$config.currency|default:"$"}{$payment.data.COUPON_DISCOUNT|string_format:"%.2f"}
    {/if}
    Which resolves to this:

    Code:
    Your order details are below:
    
    Invoice Number #38
    
    Product/Subscription Title                         Price
    -----------------------------------------------------------
    Item 1                                             $7.50
    Item 2                                             $7.50
    Item 3                                             $7.50
    Item 4                                             $7.50
    -----------------------------------------------------------
    Total                                              $30.00
    
    
    With your coupon you saved:
    -----------------------------------------------------------
    Discount                                           $10.00
    Since the item price displays as already discounted when used in the Pending e-mail, I had to move the Discount information outside of the Total area (otherwise it made it look like the discount should be taken off the total even though it had already been applied). Then I just had to remove the Subtotal line (since it doesn't work) and put the Discount code at the bottom, which I actually think makes it stand out more to the customer. And if a coupon isn't used, the coupon lines don't appear.

    I think I'm satisfied with this (thank you alexander for the offer to modify the code, but I'd rather leave it).

    Hope this helps others.

    Kodi

Share This Page