WCMp Core
-
AuthorPosts
-
-
June 17, 2022 at 12:43 AM #138005l.ganParticipant
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
-
June 17, 2022 at 6:10 PM #138032MVX Support NinjaKeymaster
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); }
CopyRegards,
-
June 17, 2022 at 7:02 PM #138039l.ganParticipant
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
-
June 21, 2022 at 6:26 PM #138132MVX Support NinjaKeymaster
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); }
CopyRegards.
-
July 2, 2022 at 1:08 AM #139133l.ganParticipant
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.
-
July 4, 2022 at 4:11 PM #140032l.ganParticipant
Hello, I figured out the code and everything is fine. thanks for your help
-
July 4, 2022 at 5:41 PM #140034MVX Support NinjaKeymaster
Hi,
Thank you for your conformation.Regards,
-
-
AuthorPosts
The topic ‘move” by-vendor-name-link” to “woocommerce_shop_loop_item_title”?’ is closed to new replies.