Claim your freedom to choose the perfect partner for your multi-vendor journey.

FREEDOM25

Celebrate the festive season by giving your marketplace a powerful lift!

FESTIVE20

5.0.0
Something big is coming for marketplace admins… MultiVendorX 5.0 is almost here. Are you ready?
Be the first to explore all the game-changing features!
Power your marketplace dreams with unbeatable Black Friday deals!

MVXBLACK30

Supercharge your marketplace vision with unstoppable Cyber Monday deals!

MVXCYBER30

Holiday cheer, bigger savings
Take 25% off-because your marketplace deserves a gift too.

happyholiday

Display a random list of other vendors on a vendor’s store page

Resolved
Viewing 7 reply threads
  • Author
    Posts
    • #220087
      l.gan
      Participant

      Hello

      Thanks for the great support.

      I’m trying to display a random list of other vendors on a vendor’s store page, like a “Check out more of these vendors” suggestion. I succeeded, but I can’t figure out how to get images of the vendor’s logo (their avatar, which is loaded into the dashboard) and the average rating?

      Please help me, my code is:

      function get_random_taxonomies() {
       $current_taxonomy = get_queried_object();
       $taxonomies = get_terms(array(
       'taxonomy' => 'dc_vendor_shop',
       'number' => 10,
       'orderby' => 'rand',
       ));
      
       $output = '<ul>';
       foreach ($taxonomies as $taxonomy) {
       if ($taxonomy->term_id !== $current_taxonomy->term_id) {
       $output .= '<li><a href="' . get_term_link($taxonomy) . '">' . $taxonomy->name . '</a></li>';
       }
       }
       $output .= '</ul>';
       return $output;
      }

      output echo get_random_taxonomies();

    • #220102

      Hello @l.gan, I have forwarded this to our development team. They will review this, and I will update you as soon as I receive their feedback.

      Please note that this might take some time, as the team is currently occupied with preassigned tasks.

      Thank you for your understanding.

    • #220170

      Hi @l.gan, Kindly incorporate the below code on your end to get the vendor logo and rating.

      $vendor = get_mvx_vendor($taxonomy->term_id);
      $image = $vendor->get_image() ? $vendor->get_image('image', array(125, 125)) : $MVX->plugin_url . 'assets/images/WP-stdavatar.png'
      $rating_info = mvx_get_vendor_review_info($taxonomy->term_id);
      $MVX->template->get_template('review/rating_vendor_lists.php', array('rating_val_array' => $rating_info));

      Let us know if you need any further assistance from our end.

      • #220172
        l.gan
        Participant

        Thank you for your help, could you please share the complete code fragment, because my attempts to write it resulted in numerous errors since I am not very good at php

    • #220173

      Ok. Let me share this with the dev team. They will look into it.
      Once I hear back from them I will get back to you accordingly.

      • #220517
        l.gan
        Participant
        This reply has been marked as private.
    • #220529

      @l.gan, To get the vendor image you can simply follow the below given code snippet –


      $vendor = get_mvx_vendor($taxonomy->term_id);
      $image = $vendor->get_image() ? $vendor->get_image('image', array(125, 125)) : $MVX->plugin_url . 'assets/images/WP-stdavatar.png'

      Let us know if you need any further assistance from our end.

    • #220539
      l.gan
      Participant
      This reply has been marked as private.
    • #220542

      Hi there,

      Thanks for sharing the details with us. Since you are implementing a custom flow with custom code, it’s challenging for us to review and assist with your modifications.

      However, I will share this with the dev team and keep you posted once I hear back from them.

    • #237942

      It’s been long and we have not heard back from you. We presume your query has been resolved. We are closing this thread. If you need help or face issue in future please do create a new support ticket.

Viewing 7 reply threads
  • The topic ‘Display a random list of other vendors on a vendor’s store page’ is closed to new replies.
Shopping Cart
Scroll to Top