Announcement

Collapse
No announcement yet.

Printable Invoice Problems Help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Printable Invoice Problems Help

    The default Printable Invoice shows the total for each line item purchased regardless of quantity. It does total correctly at the bottom. I would like the Printable Invoice to show the price for one and then the total for quantity times price.

    Code Product Quantity Product Price Total

    0621 Norse American 5-cent Stamp. 2 $25.00 $50. 00

    Also, the "Bill To" info should be on the right, as it is, and has been, in the rest of Miva. This may seem petty, but most of us are use to looking to the right data set for this info. Consistancy is important.
    Last edited by allstamp; 03-04-15, 09:22 PM.

    #2
    Re: Printable Invoice Problems Help

    The Printable Invoice is a page template which can be customized to include any data you like.

    Below is an example which has the two changes you need:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>&mvte:page:name;</title>
    <style type="text/css"><mvt:item name="inline_css" /></style>
    </head>
    <body>
    
    
    <mvt:foreach iterator="order" array="admin_order:orders">
        <div class="order">
            <div class="title-box-left">
                <!-- Uncomment to add a logo to your invoice <img src="images/logo.jpg" height="34px" width="60px" /> -->
                <h3>&mvte:store:name;</h3>
                &mvte:store:address;<br />
                &mvte:store:city;, &mvte:store:state; &mvte:store:zip;<br />
                &mvte:store:country;
            </div>
    
    
            <div class="title-box-right">
                <h1>Order Summary</h1>
                Date: &mvt:order:date;<br />
                Order: #&mvt:order:id;<br />
                Order Status: &mvt:order:formatted_status;<br />
            </div>
    
    
            <div class="clear"></div>
            <hr />
    
    
            <div class="purple-box">
                <div class="sub-box-right">
                    <h2>Bill To</h2>
                    <hr />
                    <table><tr><th>Name:</th><td>&mvte:order:bill_fname; &mvte:order:bill_lname;</td></tr></table>
                    <table><tr><th>Email:</th><td>&mvte:order:bill_email;</td></tr></table>
                    <table><tr><th>Phone:</th><td>&mvte:order:bill_phone;</td></tr></table>
                    <table><tr><th>Fax:</th><td>&mvte:order:bill_fax;</td></tr></table>
                    <table><tr><th>Company:</th><td>&mvte:order:bill_comp;</td></tr></table>
                    <table><tr><th>Address:</th><td>&mvte:order:bill_addr;<br />&mvte:order:bill_city;, &mvte:order:bill_state; &mvte:order:bill_zip;<br />&mvte:order:bill_cntry;</td></tr></table>
                </div>
    
    
                <div class="sub-box-left">
                    <h2>Send To</h2>
                    <hr />
                    <table><tr><th>Name:</th><td>&mvte:order:ship_fname; &mvte:order:ship_lname;</td></tr></table>
                    <table><tr><th>Email:</th><td>&mvte:order:ship_email;</td></tr></table>
                    <table><tr><th>Phone:</th><td>&mvte:order:ship_phone;</td></tr></table>
                    <table><tr><th>Fax:</th><td>&mvte:order:ship_fax;</td></tr></table>
                    <table><tr><th>Company:</th><td>&mvte:order:ship_comp;</td></tr></table>
                    <table><tr><th>Address:</th><td>&mvte:order:ship_addr;<br />&mvte:order:ship_city;, &mvte:order:ship_state; &mvte:order:ship_zip;<br />&mvte:order:ship_cntry;</td></tr></table>
                </div>                    
            </div>
    
    
            <table class="product-info">
                <tr>
                    <th class="code">Code</th>
                    <th class="product">Product</th>
                    <th class="quantity">Quantity</th>
                    <th class="price">Price</th>
                    <th class="total">Total</th>
                </tr>
    
    
                <mvt:foreach iterator="item" array="order:items">
                    <tr class="highlighted">
                        <td class="code">&mvt:item:code;</td>
                        <td class="product">&mvt:item:name;</td>
                        <td class="quantity">&mvt:item:quantity;</td>
                        <td class="quantity">&mvt:item:formatted_price;</td>
                        <td class="total">&mvt:item:formatted_subtotal;</td>
                    </tr>
    
    
                    <mvt:foreach iterator="option" array="item:options">
                        <tr>
                            <td class="code"></td>
                            <td class="product">
                                <mvt:if expr="l.settings:option:option_id">
                                    &mvt:option:attr_code;: &mvt:option:opt_code;
                                <mvt:elseif expr="NOT ISNULL l.settings:option:data">
                                    &mvt:option:attr_code;: &mvt:option:data;
                                <mvt:elseif expr="NOT ISNULL l.settings:option:data_long">
                                    &mvt:option:attr_code;: &mvt:option:data_long;
                                <mvt:else>
                                    &mvt:option:attr_code;
                                </mvt:if>
                            </td>
                            <td class="quantity"></td>
                            <td class="price"></td>
                            <td class="total">
                                <mvt:if expr="l.settings:option:subtotal">
                                    &mvt:option:formatted_subtotal;
                                </mvt:if>
                            </td>
                        </tr>
                    </mvt:foreach>
                </mvt:foreach>
    
    
                <tr class="highlighted">
                    <td colspan="4" class="shippingTax">
                        <mvt:foreach iterator="charge" array="order:charges">
                            &mvt:charge:descrip;:<br />
                        </mvt:foreach>
    
    
                        <h2>Total:</h2>
                    </td>
                    <td class="totalFinal">
                        <mvt:foreach iterator="charge" array="order:charges">
                            &mvt:charge:formatted_disp_amt;<br />
                        </mvt:foreach>
    
    
                        <h2>&mvt:order:formatted_total;</h2>
                    </td>
                </tr>            
            </table>
    
    
            <div class="purple-box">
                <div class="sub-box-left">
                    <h2>Payment</h2>
                    <hr />
    
    
                    <mvt:if expr="( ISNULL l.settings:order:payment:fields ) AND ( NOT ISNULL l.settings:order:payment:descrip )">
                        <table><tr><th>Payment Method:</th><td>&mvt:order:payment:descrip;</td></tr></table>
                    <mvt:else>
                        <mvt:foreach iterator="field" array="order:payment:fields">
                            <table><tr><th>&mvt:field:label;</th><td>&mvt:field:value;</td></tr></table>
                        </mvt:foreach>
                    </mvt:if>
                </div>
    
    
                <div class="sub-box-right">
                    <h2>Shipping</h2>
                    <hr />
    
    
                    <mvt:if expr="( ISNULL l.settings:order:ship_fields ) AND ( NOT ISNULL l.settings:order:ship_method )">
                        <table><tr><th>Shipping Method:</th><td>&mvt:order:ship_method;</td></tr></table>
                    <mvt:else>
                        <mvt:foreach iterator="field" array="order:ship_fields">
                            <table><tr><th>&mvt:field:label;</th><td>&mvt:field:value;</td></tr></table>
                        </mvt:foreach>
                    </mvt:if>
                </div>
            </div>
        </div>
    </mvt:foreach>
    </body>
    </html>
    Last edited by Brennan; 03-05-15, 10:23 AM.
    Brennan Heyde
    VP Product
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment


      #3
      Re: Printable Invoice Problems Help

      Thank you for your help. That was very quick and looks extensive. I'll install it a try right away. I'm thinking this should be the default code for the printable invoice. It should bring it more in line with the legacy invoice default format.

      Comment


        #4
        Re: Printable Invoice Problems Help

        Thank you again. That works perfectly. I appreciate the formatting and that you listed all the code for the page, rather than giving me a few lines to place/replace. Now everyone can cut and paste this code to get the ideal printable invoice.

        Comment


          #5
          Re: Printable Invoice Problems Help

          Great. I did all and works great for me too..

          One more question. How do we remove all the nitty gritty payment information and just show the Payment method ie. Visa or Paypal or Amazon, etc.

          Comment


            #6
            Re: Printable Invoice Problems Help

            The payment data is output within a foreach loop, where it will loop though and display all payment data available.

            Code:
            <mvt:foreach iterator="field" array="order:payment:fields">
                <table><tr><th>&mvt:field:label;</th><td>&mvt:field:value;</td></tr></table>
            </mvt:foreach>
            If you just want one piece of data, you would need to identify its label (or code) then reference it like this:

            Code:
            <mvt:foreach iterator="field" array="order:payment:fields">
                <mvt:expr="l.settings:field:label 'cardtype' ">
                        &mvte:field:label; - &mvt:field:value;
                    </mvt:if>
            </mvt:foreach>
            Last edited by Brennan; 03-10-15, 08:17 AM.
            Brennan Heyde
            VP Product
            Miva, Inc.
            [email protected]
            https://www.miva.com

            Comment


              #7
              Re: Printable Invoice Problems Help

              Hmm... That didn't seem to work for me. It would be great to use these printable invoices but I don't want to print all the credit card information.

              I'm also having trouble getting a page break to happen when I print. I see that the stock CSS for this has a page break for the orders class but that doesn't seem to work. I've tried two other ways to call for a page break and it just won't work. Es no muy bueno. The printable invoices are basically useless unless I can get them to print one per page.
              Matt E.
              www.harpkit.com

              Comment


                #8
                Re: Printable Invoice Problems Help

                There was an error in the code above, try this:

                Code:
                <mvt:foreach iterator="field" array="order:payment:fields">
                    <mvt:expr="l.settings:field:label  EQ 'cardtype' ">
                            &mvte:field:label; - &mvt:field:value;
                        </mvt:if>
                </mvt:foreach>
                Brennan Heyde
                VP Product
                Miva, Inc.
                [email protected]
                https://www.miva.com

                Comment


                  #9
                  Re: Printable Invoice Problems Help

                  I thought I saw somewhere that the page breaks in CSS files don't work for emails, that the page break has to be within the actual HTML template. Not sure if that's so though.

                  We include the following code in our shipping confirmation email template to do page breaks.
                  <p style="page-break-after:always;"></p>

                  <!-- for Outlook emails -->
                  <!--[if gte mso 9]>
                  <span style='font-size:11.0pt;line-height:115%;font-family:"Calibri","sans-serif";
                  mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:
                  minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi-font-family:"Times New Roman";
                  mso-bidi-theme-font:minor-bidi;mso-ansi-language:EN-US;mso-fareast-language:
                  EN-US;mso-bidi-language:AR-SA'><br clear=all style='mso-special-character:line-break;
                  page-break-before:always'>
                  </span>
                  <p class=MsoNormal><o:p>&nbsp;</o:p></p>
                  <style type="text/css">
                  </style>
                  <![endif]-->

                  (Not sure how much of the Outlook page break code is needed. It was copied from a Word document that had been converted to HTML. We just use it as copied.)
                  Larry
                  Last edited by wajake41; 10-29-15, 02:28 PM.
                  Larry
                  Luce Kanun Web Design
                  www.facebook.com/wajake41
                  www.plus.google.com/116415026668025242914/posts?hl=en


                  Comment


                    #10
                    Re: Printable Invoice Problems Help

                    I think there is still an error in that code, Brennan. Looks like the second line should start <mvt:if expr= and NOT <mvt:expr=

                    However, I still couldn't get it to do what I wanted. Probably because this level of coding is a bit over my head.

                    My current solution is this:

                    Code:
                                    
                    <div class="sub-box-left">
                                        <h2>Payment</h2>
                                        <hr />
                                           <mvt:if expr="NOT ISNULL l.settings:order:payment:descrip">
                                            <table><tr><th>Payment Method:</th><td>&mvt:order:payment:descrip;</td></tr></table>
                                        </mvt:if>              
                                </div>
                    This is close to what I want. It returns either 'Authorize.net' or 'Paypal'. Ideally I would like it to return the type of credit card used. I'm sure it can be done but, for right now, I'm going to stop trying to figure out tokens, variables, and entities. I'm going crazy.
                    Last edited by harpkit; 10-30-15, 07:39 AM.
                    Matt E.
                    www.harpkit.com

                    Comment


                      #11
                      Re: Printable Invoice Problems Help

                      Thanks, Larry. I had tried this - <p style="page-break-after:always;"></p>. I've got it in the ORDER_INVOICE template right before the closing body tag. But it still won't print correctly. All the invoices just run together...
                      Matt E.
                      www.harpkit.com

                      Comment

                      Working...
                      X