Access to get_user_meta a or add a new page in dashboard

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 – Feature Request Access to get_user_meta a or add a new page in dashboard

Viewing 5 reply threads
  • Author
    Posts
    • #42582
      Cesar
      Guest

      Hi everyone, i’m doing a new shipping method, and i need vendor address. First i tried to access through get_user_meta($user_id or $vendor_id, ‘_wcfm_city’) , and i didn’t get value of this meta (i’ve already put value in settings of a test vendor).

      I did print_r( $package) before checkout filter and $vendor_id appear as [protected], i think this is why i didn’t. Get meta value.

      So, if i can’t do this by get_user_meta, how can i put a new page of setting for vendors with two select dropdown and a text field, for address sender that i can Access from my custom shipping method?.

      Thanks

    • #42609
      WCFM Forum
      Keymaster

      HI,

      Use this to get store address –

      $store_user  = wcfmmp_get_store( $vendor_id );
      $address     = $store_user->get_address();

      Thank You

    • #42876
      cesar
      Guest

      Thanks, this helped me, but only when i put manually the $vendor_id, eg:
      $store_user = wcfmmp_get_store( 2 );

      have i declare where take $vendor_id?? when i put just like you post, doesn´t work. Do not return any data, but when i put some vendor id manually, work perfect.

      Thanks A Lot!

    • #42895
      WCFM Forum
      Keymaster

      Hi,

      Well, you have to get $vendor_id dynamically, you can not set this static.

      Suppose, you are on a single product page then you have to generate that product’s vendor_id.

      Between, where you are using this code? In which page?
      I will know you , how you can generate vendor_id for that page!

      Thank You

    • #42911
      Cesar
      Guest
      This reply has been marked as private.
    • #42920
      WCFM Forum
      Keymaster

      Hi,

      You require code like this –

      foreach (WC()->cart->get_cart() as $item) {
      if ($item['data']->needs_shipping()) {
      $product_id = $item['product_id'];
      $vendor_id = $WCFM->wcfm_vendor_support->wcfm_get_vendor_id_from_product( $product_id );
      }
      }

      An other question is how can i set that for each group of parcel of diferent vendors have to make a new calculate because could be diferent origin.
      – You have to group cart items as per vendor.

      Thank You

Viewing 5 reply threads
  • The topic ‘Access to get_user_meta a or add a new page in dashboard’ is closed to new replies.