Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Marketplace (WooCommerce Multivendor Marketplace) › How can I show the city of the seller in the presentation of the product on the
- This topic has 1 reply, 2 voices, and was last updated 5 years, 3 months ago by WCFM Forum.
Viewing 1 reply thread
- AuthorPosts
- August 14, 2019 at 2:03 am #76521
- August 20, 2019 at 6:18 am #77411WCFM ForumMember
Hi,
Please use this code for the purpose –
add_action('woocommerce_after_shop_loop_item_title', function() { global $WCFM, $WCFMmp, $product; if ( wcfm_is_store_page() ) return; if( !$product ) return; $product_id = $product->get_id(); $vendor_id = $WCFM->wcfm_vendor_support->wcfm_get_vendor_id_from_product( $product_id ); if( $vendor_id ) { $vendor_data = get_user_meta( $vendor_id, 'wcfmmp_profile_settings', true ); $city = isset( $vendor_data['address']['city'] ) ? $vendor_data['address']['city'] : ''; echo '<div><span class="wcfm_dashboard_item_title">' . $city . '</span></div>'; } }, 51 );
Add this code to your child theme’s functions.php
In case you do not have child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets/Thank You
- AuthorPosts
Viewing 1 reply thread
- You must be logged in to reply to this topic.