Banner Logo

Be a part of the family: Connect, Receive Support,
Contribute, and Reap Abundant Rewards

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

MultivendorX

Open
Viewing 6 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;
      }
      Copy

      output

      echo get_random_taxonomies();
      Copy
    • #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));
      
      Copy

      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'
      
      Copy

      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.

Viewing 6 reply threads

Please LOGIN to reply to this topic