Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Hello Theo,
    If you’re not using a customized setup, the billing address will be automatically copied to the shipping address if the customer leaves it empty.
    I’m not sure I understand your requirement ‘if the shipping_address is empty or the same as the billing_address’. Do you mean when it’s not the same? For that scenario there is already an setting, under the ‘Template’ settings you can check the option to show the billing address on the packing slip or the shipping address on the invoice if they differ (that’s what the code you pasted does).

    Ewout

    Thread Starter Theo van der Plas

    (@leefdesign)

    Hey Ewout,

    Normally it prints the billing_address on the left and the shipping_address on the right of the PDF when the setting on the template page is enabled. What I want if the shipping_address is the same as the billing_address that it still prints 2 addresses. So 2 times billing_address if shipping is to the same address. Right now it hides the shipping_address when its the same as the billing_address.

    I hope you understand what I want.

    Plugin Contributor Ewout

    (@pomegranate)

    I see – add this line to your theme functions, this will always display both addresses:

    add_filter( 'wpo_wcpdf_ships_to_different_address', '__return_true' );

    Hope that helps!
    Ewout

    Thread Starter Theo van der Plas

    (@leefdesign)

    Works great ! Thank you so much Je bent een held ! ??

    Plugin Contributor Ewout

    (@pomegranate)

    Great – graag gedaan :)!
    If you can spare a minute for a review, I’d really appreciate that – thanks in advance!

    Ewout

    Thanks for link to this forum topic as I need the shipping address to always print on invoices.
    Sorry, but I am a novice when it comes to functions.
    Where exactly to I insert the provided function?
    add_filter( ‘wpo_wcpdf_ships_to_different_address’, ‘__return_true’ );

    Plugin Contributor Ewout

    (@pomegranate)

    Hi!
    You put that in your theme functions/functions.php (linked in the post above as well).
    theme functions

    Hope that helps!
    Ewout

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Shipping address on pdf’ is closed to new replies.