Display store address in checkout
-
Hi,
I would like to able to display the store address in checkout page when local pickup shipment method is selected.
By default appears “Local pickup” and doesn’t give information to the customer where to pickup the order.
Can you provide the code or plugin to have this feature?
I think that for local pickup is strongly necessary to inform the customer where to pickup the order.
I’ve tried with the following code, but only obtain to display this information in each cart product, and I would like to display in the shipment field:
add_action( ‘woocommerce_add_order_item_meta’, ‘dp_add_vendor_to_order_item_meta’, 10, 2);
function dp_add_vendor_to_order_item_meta( $item_id, $cart_item) {
$vendor_id = $cart_item[ ‘data’ ]->post->post_author;
// build up address
$address1 = get_user_meta( $vendor_id , ‘billing_address_1’, true );
$address2 = get_user_meta( $vendor_id , ‘billing_address_2’, true );
$city = get_user_meta( $vendor_id , ‘billing_city’, true );
$store_postcode = get_user_meta( $vendor_id , ‘billing_postcode’, true );
$state = get_user_meta( $vendor_id , ‘billing_state’, true );
$address = ( $address1 != ”) ? $address1 .’, ‘ . $city .’, ‘ . $state.’, ‘. $store_postcode :”;wc_add_order_item_meta( $item_id, apply_filters(‘vendors_sold_by_in_email’, __(‘Recoger en’, ‘vendors’)), $address);
}
add_action( ‘woocommerce_add_order_item_meta’, ’email_add_vendor_to_order_item_meta’, 10, 3);
function email_add_vendor_to_order_item_meta( $item_id, $cart_item) {
$vendor_id = $cart_item[ ‘data’ ]->post->post_author;
$email_vendor = get_userdata( $vendor_id )->user_email;wc_add_order_item_meta( $item_id, apply_filters(‘vendors_sold_by_in_email’, __(‘Email’, ‘vendors’)), $email_vendor);
}Thank you!
The page I need help with: [log in to see the link]
- The topic ‘Display store address in checkout’ is closed to new replies.