Set Vendor Shop Name and Slug Automatically

WCMp Mangopay Marketplace

Resolved
Viewing 4 reply threads
  • Author
    Posts
    • #135826
      paul.vivancos
      Participant

      Hey,
      Sorry to bother you but we can’t set up an automatic shop name and slug. We tried with updating metas like : “vendor_page_title” and “vendor_page_slug”, etc.
      But nothing is working, we still have to go on the admin dashboard and setup a name for each vendor. Is there a way to setup those values automatically ?

      Can you help us ?

      Thanks in advance.

    • #135851

      you can update term like this way
      for name :

      $this->term_id = get_user_meta($this->id, '_vendor_term_id', true);
      wp_update_term($this->term_id, $MVX->taxonomy->taxonomy_name, array('name' => $title)))
      Copy

      for slug :

      wp_update_term($this->term_id, $MVX->taxonomy->taxonomy_name, array('slug' => $slug))
      Copy

      Thanks

    • #135865
      paul.vivancos
      Participant

      Hello,
      Thanks for your reply.

      I have a bit modified the code to create a new term and apply it to a new user when a account is created.

      Copy

      `
      $create_term = wp_create_term($shopName2, “dc_vendor_shop”);
      $add_meta = add_user_meta($user_id, “_vendor_term_id”, $create_term[“term_id”]);

      Copy

      `

      This is working to insert name and slug. But now the problem is when the user create a new product, it isn’t linked to his account.

      Is there anything missing ?

      Thanks in advance.

    • #135866
      paul.vivancos
      Participant

      Update :
      I use this code to create user meta and term meta and link it to the new user. It’s working very well.

      Copy

      `
      $create_term = wp_create_term($shopName2, “dc_vendor_shop”);
      $add_meta = add_user_meta($user_id, “_vendor_term_id”, $create_term[“term_id”]);
      $term_meta = add_term_meta($create_term[“term_id”], “_vendor_user_id”, $user_id);

      Copy

      `

      Thanks for the answer and the support.

    • #135979

      we are happy to help you
      We would love it if you shared your experience by giving us 5/5 review here :
      https://wordpress.org/support/plugin/dc-woocommerce-multi-vendor/reviews/#new-post
      Seeing glowing reviews from existing customers makes others more comfortable knowing they’ll get the support they need with an issue with our services when arise.

Viewing 4 reply threads

The topic ‘Set Vendor Shop Name and Slug Automatically’ is closed to new replies.