• Resolved pixelaid

    (@pixelaid)


    I know I can customize the template, but I am using Galleria, a child theme of Storefront, so I cannot create a child theme and edit the PDF Invoices (Simple) template.

    Is there a way to replace the text “Order Number:” with something else, using functions.php? My client wants to only display the Invoice number and not the Order Number, I’m thinking of replacing “Order Number:” with “Invoice Number:”

    Alternatively, can i simple hide “Order Number:” and only display “Invoice Number:” ?

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

    (@pomegranate)

    Hi! Replacing the text “Order Number” with “Invoice Number” is not a good idea, as invoice numbers are required to be sequential in most countries. But you can hide the order number using CSS. Doing this in functions.php will have the same downside as adding custom templates as it will be overwritten when your child theme gets updated, but you can use the Code Snippets plugin instead. You can then hide the order number with:

    
    add_action( 'wpo_wcpdf_custom_styles', 'wpo_wcpdf_custom_styles', 10, 2 );
    function wpo_wcpdf_custom_styles ( $document_type, $document ) {
        ?>
        .invoice .order-number { display: none; }
        <?php
    }
    
    Thread Starter pixelaid

    (@pixelaid)

    This is perfect – thank you so much, Ewout.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Replace ‘Order Number:’ text using functions.php’ is closed to new replies.