Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Marketplace (WooCommerce Multivendor Marketplace) › I need store country displayed on single product page
- This topic has 2 replies, 2 voices, and was last updated 5 years, 4 months ago by ing.rapparini.
Viewing 2 reply threads
- AuthorPosts
- July 4, 2019 at 9:24 am #71005ing.rappariniParticipant
I need store country displayed on single product page as shown in this pics.
Is it possible?Attachments:
You must be logged in to view attached files. - July 4, 2019 at 9:58 am #71016WCFM ForumMember
Hi,
Please use this code for the purpose –
add_action( 'woocommerce_product_meta_start', function() { global $WCFM, $WCFMmp, $product; $product_id = $product->get_id(); $vendor_id = $WCFM->wcfm_vendor_support->wcfm_get_vendor_id_from_product( $product_id ); if( $vendor_id ) { $store_user = wcfmmp_get_store( $vendor_id ); $store_address = $store_user->get_address(); if( $store_address && is_array( $store_address ) && !empty( $store_address ) ) { $country = isset( $store_address['country'] ) ? $store_address['country'] : ''; if( $country ) { $country_obj = new WC_Countries(); $countries = $country_obj->countries; $country_name = ''; if( $country ) $country_name = $country; if( $country && isset( $countries[$country] ) ) { $country_name = $countries[$country]; } echo '<div class="wcfm_clearfix"></div><div class="wcfmmp_shipment_processing_display">Country: ' . $country_name . '</div><div class="wcfm_clearfix"></div>'; } } } }, 51 );
Will show country here – https://ibb.co/26yZjps
Than you
- July 9, 2019 at 6:40 am #71671ing.rappariniParticipant
WOW!
THANK YOU VERY MUCH!!!
- AuthorPosts
Viewing 2 reply threads
- The topic ‘I need store country displayed on single product page’ is closed to new replies.