• Resolved monicaramostv

    (@monicaramostv)


    I’ve been trying to figure out how to show the just the customer Name instead of N/A when there is no shipping address. I just want to print packing slips for my local pickup customers. Even if I select use Billing Address when there is no shipping, it still leaves an area where Shipping Address would go that has N/A. I just want the packing slip to include the name, but if I can even just get the billing info (with address) but WITHOUT the N/A placeholder for shipping address I’ll settle for that. If I can code it please let me know. But if it requires purchasing the custom template just to do that one thing, I’ll buy it, but that’s all I need. Thanks.

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

    (@pomegranate)

    Hi Monica,
    You can do this by using the wpo_wcpdf_shipping_address filter.

    
    add_filter( 'wpo_wcpdf_shipping_address', 'wpo_wcpdf_shipping_address_empty', 10, 1 );
    function wpo_wcpdf_shipping_address_empty($shipping_address) {
    	global $wpo_wcpdf;
    	if ($shipping_address == __('N/A', 'wpo_wcpdf') || empty($shipping_address)) {
    		$shipping_address = trim($wpo_wcpdf->export->order->billing_first_name.' '.$wpo_wcpdf->export->order->billing_last_name);
    	}
    	return $shipping_address;
    }
    

    Read this if you haven’t worked with filters/functions.php before!

    Ewout

    Thread Starter monicaramostv

    (@monicaramostv)

    Thank you!!! Worked perfectly!

    Plugin Contributor Ewout

    (@pomegranate)

    You’re welcome! If you can spare a minute, please leave a review ??

    Have a fantastic day!

    Ewout

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Show Customer Name instead of N/A when no shipping address’ is closed to new replies.