• Resolved reign1

    (@reign1)


    Hi,

    I’ve an issue with items in the packing slip. Even though that some items in the order are set to be non-returnable I still see them in the packing slip. Any idea why?

    BR,
    Gytis

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

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

    (@pomegranate)

    Hello Gytis,
    What exactly do you mean by ‘non-returnable’? Are you referring to virtual or downloadable products? If so, you can either use a code snippet:

    
    add_filter( 'wpo_wcpdf_order_items_data', 'wpo_wcpdf_remove_downloadable_items', 10, 3 );
    function wpo_wcpdf_remove_downloadable_items ( $items_data, $order, $document_type ) {
        if ( $document_type == 'packing-slip' ) {
            foreach ($items_data as $key => $item) {
                // Check if product is downloadable or virtual
                if ( !empty($item['product']) && ( $item['product']->is_downloadable() || $item['product']->is_virtual() ) ) {
                    // if true - remove item from packing slip
                    unset( $items_data[$key] );
                }
            }
        }
        return $items_data;
    }
    

    or if you want a no-code solution, it’s a setting our the Professional extension:

Viewing 1 replies (of 1 total)
  • The topic ‘Wrong items in the packing slip’ is closed to new replies.