Custom description of setup charge?

david.ells's Avatar

david.ells

14 Oct, 2009 05:30 AM

I'd like to save a custom description for the setup charge related to my subscription plans, for the purpose of better explanation of the line item in the invoice the customer will receive. Is this possible, or easy to implement?

  1. Support Staff 1 Posted by Marc Guyer on 14 Oct, 2009 02:56 PM

    Marc Guyer's Avatar

    This functionality can be achieved by building a custom invoice layout for the "Payment Receipt" and "Payment Declined" email templates.

  2. Marc Guyer closed this discussion on 14 Oct, 2009 02:56 PM.

  3. david.ells re-opened this discussion on 14 Oct, 2009 03:48 PM

  4. 2 Posted by david.ells on 14 Oct, 2009 03:48 PM

    david.ells's Avatar

    Can you give me the current smarty template code used for the default invoice layout? Really the whole purpose we're using the setup charge for is for charging the subscription fee up front each month, and we want our setup charge line item to read "First month's service". Is this up front charging a future feature of CG? What is the timeline for it if so?

  5. Support Staff 3 Posted by Marc Guyer on 14 Oct, 2009 04:03 PM

    Marc Guyer's Avatar

    The default invoice layout is a simple smarty variable that contains the default layout produced by CG. In other words, there isn't any smarty syntax other than the convenience variable {$invoice.asciiLayout}.

    We do have plans to write one in the context of a KB article as an example.

    We have considered providing a facility for charging the recurring charge at the beginning of the first billing period but we do not have an estimated arrival of this functionality at this time.

  6. Marc Guyer closed this discussion on 14 Oct, 2009 04:03 PM.

  7. david.ells re-opened this discussion on 14 Oct, 2009 10:47 PM

  8. 4 Posted by david.ells on 14 Oct, 2009 10:47 PM

    david.ells's Avatar

    I need some help recreating the default ascii layout invoice using a smarty template. So far I have

    ************************************************************
    INVOICE #{$invoice.invoiceNumber} {$invoice.billingDatetime|date_format:"%m/%d/%Y"|string_format:"%46s"}
    ************************************************************
    
    Billed To: {$customer.firstName|string_format:"%13s"} {$customer.lastName}
    Payment Method:{$subscription.ccType|upper|string_format:"%7s"}  ***{$subscription.ccLastFour}
    Amount Billed:    ${$transaction.amount}
    
    Quantity    Description                               Amount
    ````````````````````````````````````````````````````````````
    

    Which works just fine, but I can't loop over the charges at all. I'm admittedly annoyed that setup charges can't just have descriptions that are shown automatically on the invoice like everything else, but I am trying to make due. Unfortunately I'm having a tough time doing that. When I try to loop over the charges using syntax like this:

    {foreach from=$charges item=charge}
        {$charge.quantity} {$charge.code} {$charge.type}
    {foreach}
    

    I get syntax errors saying: (foreach: missing 'from' attribute), and (unclosed tag {foreach}.
    Apparently this otherwise valid smarty syntax is not valid. How do I loop over the charges for the invoice?

  9. Support Staff 5 Posted by Marc Guyer on 15 Oct, 2009 10:50 PM

    Marc Guyer's Avatar

    Yeah -- I can see that this is a major hassle as a workaround. Here's a fix for your foreach:

    {foreach from=$charges item=charge}
    {$charge.quantity}@{$charge.eachAmount} each -- {$charge.quantity*$charge.eachAmount|string_format:"%01.2f"}
    {$charge.code}
    {if $charge.description}
    {$charge.description}
    {elseif $charge.type == "setup"}
    First month's service
    {/if}
    
    {/foreach}
    

    You were just missing a / in the foreach close tag.

    I see that there is a significant need for this description as well as the ability to charge a recurring charge upon signup. We're in the midst of a major upgrade that is in testing right now and should be rolled out early next week. Once that's done we'll be evaluating which feature improvements are most valuable and beginning work on them. I'm hoping that this will be one.

  10. 6 Posted by david.ells on 15 Oct, 2009 10:55 PM

    david.ells's Avatar

    Oh duh! Never noticed the forward slash to close the smarty tag. Oi. Thanks Marc.

  11. Support Staff 7 Posted by Marc Guyer on 15 Oct, 2009 11:04 PM

    Marc Guyer's Avatar

    No prob. Always happy to help.

    "It's always some mundane detail..."
    
  12. Marc Guyer closed this discussion on 15 Oct, 2009 11:04 PM.

Discussions are closed to public comments.
If you need help with Cheddar please start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac