How can I show the city of the seller in the presentation of the product on the

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

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

Viewing 1 reply thread
  • Author
    Posts
    • #76521
      Vegetaca
      Participant

      How can I show the city of the seller in the presentation of the product on the store page, thanks.

      Attachments:
      You must be logged in to view attached files.
    • #77411
      WCFM Forum
      Keymaster

      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

Viewing 1 reply thread
  • You must be logged in to reply to this topic.