• Resolved remij89

    (@remij89)


    Hello. I have been using WooCommerce PDF Invoices & Packing Slips
    with your premium template for a while. We have started taking pre-orders on some of our items. Now I need to customize further, adding some kind of information for our warehouse workers that one or more items in the packing slips is a pre-order. I have already made a custom stock status for the product page. Also every time an order is completed a function adds a custom order meta to the order (i.e. _stock_status = pre_order). How can I add this information to the packing slips?

    Here is a cropped screenshot from the order page: https://i.imgur.com/yBJimwO.jpeg

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

Viewing 1 replies (of 1 total)
  • Plugin Contributor kluver

    (@kluver)

    Hi @remij89,

    You can add an extra line to the order data table on your packing slip, based on the _stock_status order meta, via the following code snippet:

    add_action( 'wpo_wcpdf_after_order_data', 'wpo_wcpdf_add_pre_order_status', 10, 2 );
    function wpo_wcpdf_add_pre_order_status( $template_type, $order ) {
    	if ( $template_type == 'packing-slip' && $order->get_meta( '_stock_status' == 'pre_order' ) ) {
    		?>
    		<tr class="pre-order-status">
    			<th><?php _e( 'Pre-order:', 'woocommerce-pdf-invoices-packing-slips' ); ?></th>
    			<td><?php _e( 'Yes', 'woocommerce-pdf-invoices-packing-slips' ); ?></td>
    		</tr>
    		<?php
    	}
    }

    This code snippet should be added to the functions.php of your child theme or via a plugin like Code Snippets. If you haven’t worked with code snippets or functions.php before please read the following guide: How to use filters

    Also, you mention you are also using our Premium Templates extension. Since we are not allowed to give paid support on this forum I will have to kindly ask you to redirect all future support questions to: [email protected]

Viewing 1 replies (of 1 total)
  • The topic ‘Custom stock status or custom order meta in packing slips’ is closed to new replies.