Banner Logo

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

move” by-vendor-name-link” to “woocommerce_shop_loop_item_title”?

WCMp Core

Resolved
Viewing 6 reply threads
  • Author
    Posts
    • #138005
      l.gan
      Participant

      Hello

      I have it enabled in the settings – show who sells. But please tell me how can I move this item to “woocommerce_shop_loop_item_title”?

      do you have any code to override

    • #138032

      Hi,
      Kindly add below code to your function.php of the current active theme.

      add_action('init', 'wcmp_custom_sold_by_change');
      function wcmp_custom_sold_by_change() {
          global $WCMp;
          /* for single product */
          remove_action('woocommerce_product_meta_start', array($WCMp->vendor_caps, 'wcmp_after_add_to_cart_form'), 25);
          add_action('woocommerce_product_meta_start', array($WCMp->vendor_caps, 'wcmp_after_add_to_cart_form'), 10); 
      }
      Copy

      Regards,

    • #138039
      l.gan
      Participant

      As far as I understand, this is the value for the single page?

      Please do you have the same code for WooCommerce Archive Pages?

      This code adds value to woocommerce_shop_loop_item_title only if I fix it

      add_action(‘woocommerce_shop_loop_item_title’, array($WCMp->vendor_caps, ‘wcmp_after_add_to_cart_form’), 0);

      , but this does not solve my question, because the old value is not deleted – there are 2 of them. (see photo)

      Please tell me how to remove the lower vendor name.

      Thanks

    • #138132

      Hi,
      Kindly add below code to your function.php of the current active theme.

      add_action('init', 'wcmp_custom_sold_by_change');
      function wcmp_custom_sold_by_change() {
          global $WCMp;
          /* for single product */
          remove_action('woocommerce_product_meta_start', array($WCMp->vendor_caps, 'wcmp_after_add_to_cart_form'), 25);
          add_action('woocommerce_shop_loop_item_title', array($WCMp->vendor_caps, 'wcmp_after_add_to_cart_form'), 0); 
      }
      Copy

      Regards.

    • #139133
      l.gan
      Participant

      Hello, thank you for your help

      This adds the vendor name at the top, but doesn’t remove it at the bottom.

      As far as I understand, this hook will remove the value from the meta, but I need to remove the value from all pages, both archive pages and title pages. , the value that I have after the price (it is added by your plugin).
      “remove_action(‘woocommerce_product_meta_start’, array($WCMp->vendor_caps, ‘wcmp_after_add_to_cart_form’), 25);”

      I think the hook and number should be correct. Noah don’t know what order (number). sorry i’m bad at php, i tried to use “woocommerce_after_shop_loop_item” hook
      remove_action(‘woocommerce_after_shop_loop_item’, array($WCMp->vendor_caps, ‘wcmp_after_add_to_cart_form’), 10);

      but that didn’t help me either. The old value (which is below) is not removed. There are still two of them.

      add_action(‘init’, ‘wcmp_custom_sold_by_change’);
      function wcmp_custom_sold_by_change() {
      global $WCMP;
      /* for single product */
      remove_action(‘woocommerce_after_shop_loop_item’, array($WCMp->vendor_caps, ‘wcmp_after_add_to_cart_form’), 10);
      add_action(‘woocommerce_shop_loop_item_title’, array($WCMp->vendor_caps, ‘wcmp_after_add_to_cart_form’), 0);
      }

      Please help?

      I don’t know what hook this location adds, it still shows 2 values.

    • #140032
      l.gan
      Participant

      Hello, I figured out the code and everything is fine. thanks for your help

    • #140034

      Hi,
      Thank you for your conformation.

      Regards,

Viewing 6 reply threads

The topic ‘move” by-vendor-name-link” to “woocommerce_shop_loop_item_title”?’ is closed to new replies.