Alle samlinger
Avansert
Add shipping-phone to Delivery
Add shipping-phone to Delivery

Guide on how to add shipping-phone to delivery

Robin Pedersen avatar
Skrevet av Robin Pedersen
Oppdatert over en uke siden

Shipping-phone is not part of Woocommerce standard. But you can have custom functionality to register and store this information from your customers.

To properly add this phone number to deliveries, use this filter

add_filter('logistra_robots_parts_cosignee_phone', "custom_change_phone_number", 10, 2);

function custom_change_phone_number($phone, $order_id) {
$order = wc_get_order($order_id);
$shipping_phone = $order->get_SHIPPING_phone(); // Swap this out we internal logic for fetching shipping-phone
if($shipping_phone) { // Check if you have got a valid phone number
$phone = $shipping_phone;
}
return $phone
}

Svarte dette på spørsmålet?