add_filter( 'wf_pklist_alter_find_replace', function( $find_replace, $template_type, $order, $box_packing, $order_package, $html ) { if ( 'picklist' === $template_type && is_a( $order, 'WC_Order' ) ) { $billing_address = $order->get_formatted_billing_address(); $shipping_address = $order->get_formatted_shipping_address(); $billing_phone = $order->get_billing_phone(); $billing_email = $order->get_billing_email(); $shipping_phone = $order->get_shipping_phone(); $customer_note = $order->get_customer_note(); $shipping_method = $order->get_shipping_method(); // Shipping method title if ( ! empty( $billing_address ) ) { // Billing block $find_replace['[wfte_billing_address]'] = '
' . __( 'לחיוב', 'print-invoices-packing-slip-labels-for-woocommerce' ) . '
' . $billing_address . '
'; if ( ! empty( $billing_phone ) ) { $find_replace['[wfte_billing_address]'] .= '
' . __( 'טלפון לחיוב:', 'print-invoices-packing-slip-labels-for-woocommerce' ) . ' ' . esc_html( $billing_phone ) . '
'; } if ( ! empty( $billing_email ) ) { $find_replace['[wfte_billing_address]'] .= '
' . __( 'אימייל:', 'print-invoices-packing-slip-labels-for-woocommerce' ) . ' ' . esc_html( $billing_email ) . '
'; } if ( ! empty( $customer_note ) ) { $find_replace['[wfte_billing_address]'] .= '
' . __( 'הערות:', 'print-invoices-packing-slip-labels-for-woocommerce' ) . ' ' . esc_html( $customer_note ) . '
'; } $find_replace['[wfte_billing_address]'] .= '
'; // Close billing wrapper // Shipping block $find_replace['[wfte_shipping_address]'] = '
' . __( 'למשלוח', 'print-invoices-packing-slip-labels-for-woocommerce' ) . '
' . $shipping_address . '
'; if ( ! empty( $shipping_phone ) ) { $find_replace['[wfte_shipping_address]'] .= '
' . __( 'טלפון למשלוח:', 'print-invoices-packing-slip-labels-for-woocommerce' ) . ' ' . esc_html( $shipping_phone ) . '
'; } if ( ! empty( $shipping_method ) ) { $find_replace['[wfte_shipping_address]'] .= '
' . __( 'שיטת משלוח:', 'print-invoices-packing-slip-labels-for-woocommerce' ) . ' ' . esc_html( $shipping_method ) . '
'; } $find_replace['[wfte_shipping_address]'] .= '
'; // Close shipping wrapper } else { $find_replace['[wfte_billing_address]'] = ''; $find_replace['[wfte_shipping_address]'] = ''; } } return $find_replace; }, 10, 6 );