WordPress.org

Forums

WooCommerce PDF Invoices & Packing Slips
[resolved] Alt. shipping address not showing up on invoice (16 posts)

  1. niwin
    Member
    Posted 1 year ago #

    Hi

    When I choose to add an alternative shipping address (which a lot of my customers will do), this does not show up on the invoice.

    Is this a bug, or just a limitation of using simple template?

    This is my shop: http://wp.forandringsarbetarna.nu/forlaget/

    Happy for any help or reply :)

    / NW

    https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/

  2. Ewout
    Member
    Plugin Author

    Posted 1 year ago #

    Hi NW,
    In the default WooCommerce checkout, there's only a billing address and a shipping address, but not an alternative shipping address.

    As such, the invoices use the billing address (this is the person that pays/receives the invoice), and the packing slip uses the shipping address (this is the person that receives the order).

    If you want to print the default woocommerce shipping address on the invoice, you can use the following code:

    <?php $wpo_wcpdf->shipping_address(); ?>

    If you have configured your checkout differently, with an alternative shipping address, you will need to fetch this information manually from the order meta.

    Kind regards,
    Ewout

  3. Ewout
    Member
    Plugin Author

    Posted 1 year ago #

    @niwin, let me know if the above answers your question or if you need any help!

  4. niwin
    Member
    Posted 1 year ago #

    Hi Ewout

    Thanks for your help, but in the end I turned to another invoice to pdf-plugin. It suited my needs better.

    All the best!

  5. Ewout
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Niwin,
    I'm always looking to improve this plugin, can you tell me what aspect of the other invoice plugin suits your needs better? Thanks in advance!

    Ewout

  6. niwin
    Member
    Posted 1 year ago #

    Well... it feels a bit simpler. I like the layout better, plus the fact that I more easily could alter the css to my needs. Also it retrieves both invoice and shipping address as default, whick I like :)

    The one thing that it lacks, that yours have, is the WooCommerce order number.

    I suppose that one thing that might make me reconsider, apart from the ability to change the style more easily, is if you would add a text field below the price table. So it would be easier to spread the company info on the invoice.

    But I respect that that kind of customizations are limited to pro templates.

    FYI, links to my invoices:

    Yours: https://www.dropbox.com/s/9emwaj4lioeide6/faktura-479.pdf
    Other: https://www.dropbox.com/s/b9w32sn6vh63jb2/14-0066.pdf

    As you can se, the other layout suits my content better.

    I dont know if this was helpful to you, but I hope it was.

    Thanks again!

  7. Ewout
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Niwin,
    That's definitely helpful!

    I have designed the plugin in such a way that it's very easy to modify the template to your needs: change colors, fonts, images, etc, without the risk of those things being overwritten when you update the plugin (instructions on the settings page). That's definitely not limited to pro templates. If you want to use the extra fields from the template settings page to display a text field below the price table, you can just insert the following line on line 108 of invoice.php:

    <?php $wpo_wcpdf->extra_1(); ?>

    in that same template you can change billing_address() in line 61 into shipping_address().

    Can you tell me which part of the styles you find hard to change?

  8. niwin
    Member
    Posted 1 year ago #

    Okay, you got me to switch back to your plugin :)

    Been tweaking my custom template, and got it almost the way I want it. Mayhap you can help me with the last push?

    this is my current pdf: https://www.dropbox.com/s/3y446jbui0r0sgk/faktura-489.pdf

    Now, I'm trying to

    1. Center the logo

    Added a center tag to the class:

    td.header img {
    max-height: 3cm;
    width: auto;
    text-align: center;
    }
    But no effect :(

    2. Set the second <tr> as 50% witdh - and left center the text of the second <td>, tried this:

    td.document-type-label {
    width: 50%;
    text-align: right;
    }

    But its not working :(

    3. Set the third <tr> as 50% width, tried adding a shipping class and then added this:

    td.shipping-address {
    width: 50%;
    }

    But also not working. Any help would be much appriciated :)

    Thanks!

  9. Ewout
    Member
    Plugin Author

    Posted 1 year ago #

    in your case it's probably easier add inline styles in the invoice directly, like this:

    <td class="header" align="center">

    and

    <td width="50%">

    1) is not working because you're trying to change the img while you need to change the cell (just td.header would probably work)
    2) is not working because you're trying to change the h3, but you need to change the td (doesn't have a class by default)
    3) not sure where you added the class, but it should be in the td.

  10. niwin
    Member
    Posted 1 year ago #

    Sorry for taking up so much of your time - i managed to fix everything but the logo by myself. Was just about to edit my post when I got your answer.

    Will have a go with centering the logo.

    Your help is much appriciated!

    Thanks again :)

  11. Ewout
    Member
    Plugin Author

    Posted 1 year ago #

    You're welcome! A review would be much appreciated :o)

  12. niwin
    Member
    Posted 1 year ago #

    Absolutely - will do it right after this comment.

    I haven't been able to center the logo, but it doesn't matter - I made it bigger instead.

    But now there is an other isse: the 50% division of

    billing address <---> shipping adress.

    When I added a middle table to make room for <hr> tags, the width that worked before doesn't do the job anymore. As you can se here:

    https://www.dropbox.com/s/dhev6qx77ktr2yy/faktura-518.pdf

    My css for these classes are:

    .shipping-address,
    .recipient-address {
    width: 50%;
    }

    ---

    Well, if you can make sense of my problem - I'd be very happy. If not, I'll still give you 5 stars :)

  13. Ewout
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks! I'm afraid I don't understand. In the PDF you link, I think everything is 50%? Just the order information is aligned right instead of left. Also, did you apply the styles inline as I suggested? Works for me...

    <tr>
    	<td colspan="2" class="header" align="center">
    	<?php $wpo_wcpdf->header_logo(); ?>
    	</td>
    </tr>

    This is the same code as the default simple template, only without the if statement (since you're using the image anyway). Note the colspan="2", since you're only using one table cell in that row.

  14. niwin
    Member
    Posted 1 year ago #

    Well, there are actually two things I don't get straight:

    1. The invoice info has a limited area instead of all of the 50% (you can se this on the date, that needs two rows to fit).

    2. My shipping address doesn's align with the "Amount" below. It is somehow only 40% of the whole width.

    Been trying to fix this, but cant get it done :/

    This is the best I can do:

    https://www.dropbox.com/s/9wb9mopo5g04b16/faktura-522.pdf

    If you know what I am doing wrong - dont hesitate to let me know :)

  15. Ewout
    Member
    Plugin Author

    Posted 1 year ago #

    1) I think you might have an additional td in there (the default empty one with  ?)
    2) No idea. If you want everything to align, the best thing to do is use a single table.

  16. niwin
    Member
    Posted 1 year ago #

    I managed to fix the date on one row (not sure how though :))

    Also - the header thing worked perfectly - thanks.

    If you dont have a great idea to get my shipping address to align at 50%, I can live with it as it is now.

    Once again - thank you for your great support!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce PDF Invoices & Packing Slips
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic