Banner Logo

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

by-vendor-name-link problem

WCMp Core

Resolved
Viewing 8 reply threads
  • Author
    Posts
    • #116275
      l.gan
      Participant

      Could you please help me some more – I added your function
      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’])) {
      $vendor = get_wcmp_product_vendors($cart_item[‘product_id’]);
      if ($vendor) {
      echo ‘<br>’ . $vendor->page_title;
      do_action(‘after_sold_by_text_cart_page’, $vendor);
      }
      }
      return $array;
      }

      I decided to just turn on the display “Enable” for sale by “” in the plugin settings and I had problems with the display “by-vendor-name-link” on the product display page and on the single product page.

      i am using theme Woodmart.

      1. The display of the product_title entry-title is duplicated with the buy product button (please see the image https://disk.yandex.ru/i/0U6yJrGP1ynXhg). The top button appears which leads to the vendor’s store page, and the bottom (as it should be) leads to the purchase of the product. Can you tell me how can I move the vendor name like in the example image? (https://disk.yandex.ru/i/l6xDOhH-jlO9OA)

      2. on the individual product page: is now “by-vendor-name-link” displayed in “product_meta”. How can I change the position “by-vendor-name-link” to after the “product_title entry-title”?

    • #116372

      Hi,
      our replies are inline:
      1. The display of the product_title entry-title is duplicated with the buy product button
      >> For this you have to add your custom code and Woocommerce hook and filter for your custom modification. Kindly follow the link – https://www.businessbloomer.com/woocommerce-visual-hook-guide-archiveshopcat-page/ or contact your theme developer to fix this issue.

      2. on the individual product page: is now “by-vendor-name-link” displayed in “product_meta”. How can I change the position “by-vendor-name-link” to after the “product_title entry-title”?
      >> Can you please tell me in detailed and also share a screenshot so we will be able to help you out accordingly.

      Regards,

    • #116409
      l.gan
      Participant
      This reply has been marked as private.
    • #116504

      Hi,
      our replies are inline :-
      1. If I turn on the setting (Include “by whom it is sold” In the store, shopping cart and on the checkout page.) Then the vendor name is displayed as a double above in the ajax form, add to the cart, which confuses the client and does not visually immediately see the name of the vendor …
      >>Please add this code of the function.php of your current active theme to remove the default sold by text form cart and checkout page

      add_action('init', 'wcmp_custom_changes_soldby');
      function wcmp_custom_changes_soldby(){
      	global $WCMp;
      	remove_action('woocommerce_get_item_data', array($WCMp->vendor_caps, 'add_sold_by_text_cart'), 30, 2);
      }
      Copy

      Then add your custom code using below filter

      woocommerce_get_item_data
      Copy

      2.How can I move the vendor name from product_meta to the top above the product_title entry-title?
      >> Please add this code of the function.php of your current active theme
      for single product

      add_action('init', 'wcmp_remove_sold_by_single_pro_page');
      function wcmp_remove_sold_by_single_pro_page(){
      global $WCMp;
      remove_action('woocommerce_product_meta_start', array($WCMp->vendor_caps, 'wcmp_after_add_to_cart_form'), 25);
      
      add_action('woocommerce_single_product_summary', 'add_vendor_after_product_title', 0);
      }
      function add_vendor_after_product_title(){
      	global $post;
      	if ('Enable' === get_wcmp_vendor_settings('sold_by_catalog', 'general') && apply_filters('wcmp_sold_by_text_after_products_shop_page', true, $post->ID)) {
      	    $vendor = get_wcmp_product_vendors($post->ID);
      	    if ($vendor) {
      	        $sold_by_text = apply_filters('wcmp_sold_by_text', __('Sold By', 'dc-woocommerce-multi-vendor'), $post->ID);
      	        echo '<a class="by-vendor-name-link" style="display: block;" href="' . $vendor->permalink . '">' . $sold_by_text . ' ' . $vendor->page_title . '</a>';
      	    }
      	}
      Copy
      • #116528
        l.gan
        Participant

        1. Thanks, but it doesn’t work …

        2. the function raises a critical error

    • #116578

      Hi,
      our replies are inline:
      1. Thanks, but it doesn’t work …
      >> This code will only remove the sold by from cart page and checkout page. kindly checkout the video – https://www.loom.com/share/17b6f43488c04b2b904fdb9deb825e96
      after that you have to add custom code using above filter.

      2. the function raises a critical error
      >> sorry for this, we missed a 2nd bracket
      Please add this code of the function.php of your current active theme
      /* for single product */

      add_action('init', 'wcmp_remove_sold_by_single_pro_page');
      function wcmp_remove_sold_by_single_pro_page(){
      global $WCMp;
      remove_action('woocommerce_product_meta_start', array($WCMp->vendor_caps, 'wcmp_after_add_to_cart_form'), 25);
      
      add_action('woocommerce_single_product_summary', 'add_vendor_after_product_title', 0);
      }
      function add_vendor_after_product_title(){
      	global $post;
      	if ('Enable' === get_wcmp_vendor_settings('sold_by_catalog', 'general') && apply_filters('wcmp_sold_by_text_after_products_shop_page', true, $post->ID)) {
      	    $vendor = get_wcmp_product_vendors($post->ID);
      	    if ($vendor) {
      	        $sold_by_text = apply_filters('wcmp_sold_by_text', __('Sold By', 'dc-woocommerce-multi-vendor'), $post->ID);
      	        echo '<a class="by-vendor-name-link" style="display: block;" href="' . $vendor->permalink . '">' . $sold_by_text . ' ' . $vendor->page_title . '</a>';
      	    }
      	}      
      }
      Copy
    • #116612
      l.gan
      Participant
      This reply has been marked as private.
    • #116755

      Hi,
      Seems like your theme added this option kindly ask to your theme developer to hide this they will definitely help you regarding this issue.

      Regards,

    • #120015
      l.gan
      Participant

      thank you for your help, I figured it out now, you have excellent plugin support!

    • #120086

      We are happy to help @l.gan

      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 8 reply threads

The topic ‘by-vendor-name-link problem’ is closed to new replies.