• Resolved donarajaghinyan

    (@donarajaghinyan)


    Hello, is there a way to unable or disable fields so they don’t show up on PDF invoice? if yes, from where we can do that?

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 19 total)
  • Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @donarajaghinyan,

    Yes, you can hide info from the PDF documents, although depending on the info you want to hide, you would need to follow different instruction, like enabling/disabling options from the document settings, filtering the data, using filter hooks, or using CSS rules.

    If you provide more details about what you want to do, I can point you to the right direction for your specific case ??

    Thread Starter donarajaghinyan

    (@donarajaghinyan)

    Thanks for the quick reply.

    So it a catering website. People are putting their orders. and when we want to print the invoice it has

    Order Date:
    Delivery Date:

    it is causing some confusion. We want to remove “order date” from the invoice document. Is it possible?

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Thanks for providing more details, @donarajaghinyan:

    After adding the following code snippet in your site, the order date will be hidden:

    /**
     * PDF Invoices & Packing Slip for WooCommerce:
     * Add custom styles to the PDF documents 
     */
    add_action( 'wpo_wcpdf_custom_styles', function( $document_type, $document ) {
        ?>
    	/* Hide the order date */
    	.order-date {
    		display: none;
    	}
        <?php
    }, 10, 2 );

    If you haven’t worked with code snippets (actions/filters) or functions.php before, read this guide: How to use filters

    Thread Starter donarajaghinyan

    (@donarajaghinyan)

    oh no, it has to be changed in PHP code ?? any way to do via CSS or without code??

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Actually, this code snippet injects a CSS rule to your PDF documents. If you do not want to use this PHP code snippet, you will need to create a custom PDF template.

    Thread Starter donarajaghinyan

    (@donarajaghinyan)

    seems like this is more complicated — assuming the code you provided will be changed in .php file.

    can you advice where exactly it would go?
    at the beginning of the code or at the end or specific file?

    Plugin Contributor Yordan Soares

    (@yordansoares)

    If you have a child theme, you can add code snippets in its functions.php file: don’t add code snippets to the functions.php file from your parent theme, because you may lose your customizations after updating your parent theme!

    The another way to add code snippets, that is safer in my humble opinion, is to use the Code Snippets plugin: This plugin stores the code snippets in your database, so you don’t have to worry about losing your customizations after updating your plugins or theme ??

    Thread Starter donarajaghinyan

    (@donarajaghinyan)

    amazing support, you guys are the best :)) appreciate for the plugin – i used it and the code worked :)))

    THANK YOU

    Plugin Contributor Yordan Soares

    (@yordansoares)

    I’m glad to hear that you finally managed to activate it! ??

    If you don’t mind and have the time, do you think you could leave us a review?

    Thanks in advance and all the best with your store!

    Thread Starter donarajaghinyan

    (@donarajaghinyan)

    Of course, with pleasure. doing now.
    One more thing, if you can help me with a code snippet that would be highly appreciated ??

    Is it possible, when they place the order, indicate not only the date (on the pdf invoice), but the day of the week too?

    Like:

    Delivery Date: Friday, 6/23/2023

    Also, to change the format.

    Like 6/23/2023 instead of 2023/6/23

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @donarajaghinyan,

    Please add this code snippet in your site to customize the PDF document’s date:

    /**
     * PDF Invoices & Packing Slips for WooCommerce:
     * Customize the invoice date (e.g. Sunday, 12/31/2023)
     */
    add_filter( 'wpo_wcpdf_date_format', function( $date_format, $document, $date_type ) {
    	$date_format = 'l, m/d/Y';
    	return $date_format;
    }, 10, 3 );

    Let us know if you need anything else!

    P.S.: Thank you very much for the great review! ??

    Thread Starter donarajaghinyan

    (@donarajaghinyan)

    hello, thanks a lot for the quick reply.

    Hmmm seems like the code didn’t work the “Delivery Date” still shows as YYYY/MM/DD >>>> we want it to be, Weekday (e.g. Friday etc), Day of the week, MM/DD/YYYY

    hope this video helps ))): https://www.loom.com/share/7076fdfe5c114c929ceda0cc79358188?sid=1d1fb1f5-2a1e-4f24-a434-72a5272928f0

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @donarajaghinyan.

    The code snippet above is to customize the date in our PDF documents. For dates added by third-party plugins, you could try adding l, m/d/Y under Dashboard?> Settings?> General?> Date?Format?> Within the Custom field.

    Thread Starter donarajaghinyan

    (@donarajaghinyan)

    hello, thanks a lot. I did the changes in the Dashboard – but seems like it still didn’t change the PDF invoice “Delivery Date” format ((

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Could you please tell me how are you adding the delivery date in your PDF invoices, so I can try to help you further, as courtesy?

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘Customize PDF Invoice Fields’ is closed to new replies.