Banner Logo

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

Is there a way to add a link on the basket and checkout pages back to the vendor

Theme and Plugin Support

Resolved
Viewing 3 reply threads
  • Author
    Posts
    • #114782
      mike-4531
      Participant

      I’d like to be able to add a link to the “sold by” text on the basket and checkout back to the vendor, is this possible?

    • #114823

      Hi,
      Please add this code in the function.php of the current active theme :

      add_action('init', 'wcmp_change_sold_by_cart_checkout');
      function wcmp_change_sold_by_cart_checkout(){
      global $WCMp;
       remove_action('woocommerce_get_item_data', array($WCMp->vendor_caps, 'add_sold_by_text_cart'), 30, 2);
       add_action('woocommerce_get_item_data', 'add_sold_by_text_cart', 30, 2);
      }
      
      function add_sold_by_text_cart($array, $cart_item) {
          if ('Enable' === get_wcmp_vendor_settings('sold_by_catalog', 'general') && apply_filters('wcmp_sold_by_text_in_cart_checkout', true, $cart_item['product_id'])) {
              $sold_by_text = apply_filters('wcmp_sold_by_text', __('Sold By', 'dc-woocommerce-multi-vendor'), $cart_item['product_id']);
              $vendor = get_wcmp_product_vendors($cart_item['product_id']);
              if ($vendor) {
                  //$array = array_merge($array, array(array('name' => $sold_by_text, 'value' => $vendor->page_title)));
                  echo  '<br>' . $sold_by_text .'<br> <a class="by-vendor-name-link" style="display: block;" href="' . $vendor->permalink . '">' . $vendor->page_title . '</a>';
                  do_action('after_sold_by_text_cart_page', $vendor);
              }
          }
          return $array;
      }
      Copy

      Regards,

    • #114839
      mike-4531
      Participant

      Thanks you, that worked perfectly

    • #114854

      Thank you for the update. We are closing this thread for now. If you need any further help, just open another thread.

      Also, I hope you are satisfied with our assistance and plugin. A 5/5 review here- https://wordpress.org/support/plugin/dc-woocommerce-multi-vendor/reviews/#new-post , would be a great way to share your experience with others.

      This motivates us to continue providing the best experience possible and also helps others know how WC-Marketplace can make their life easier.

Viewing 3 reply threads

The topic ‘Is there a way to add a link on the basket and checkout pages back to the vendor’ is closed to new replies.