General Marketplace Discussion (User’s interaction forum)
-
AuthorPosts
-
-
April 10, 2021 at 2:05 AM #119405l.ganParticipant
Hi, I’ve been using a bunch of code to get the vendor name right on my pages. But after updating the plugin, the code stopped working.
Please see what’s wrong.
This code removed the symbol “:” and “Sold by store” (and I want to keep this function further), added the vendor’s name and moved it in the product card above the title, and also added the vendor’s name when displaying the list of products in the catalog above the title. everything is displayed normally, except for the last one: the vendor name has disappeared under the product above the title in the catalog.
here is my code, can you please help me with it.
//
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);
}//SOLD BY
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;
}//
function add_wcmp_vendor_name(){
global $product;
if($product && class_exists(‘WCMp’)){
$vendor = get_wcmp_product_vendors($product->get_id());
if($vendor){
$sold_by_text = apply_filters(‘wcmp_sold_by_text’, __(‘Sold By’, ‘dc-woocommerce-multi-vendor’), $product->get_id());
echo ‘permalink . ‘”>’ . $sold_by_text . ‘ ‘ . $vendor->user_data->display_name . ‘‘;
}
}
} -
April 10, 2021 at 6:30 PM #119421MVX Support NinjaKeymaster
Hi,
The above code is not working except the below code.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; }
CopyLet me know what you actually want with some screenshot. So we will help you accordingly.
Regards,
-
April 12, 2021 at 6:41 PM #119531l.ganParticipant
thank you, I left the code you wrote and removed the rest.
I ask for your help, because in the settings of my woodmart theme (if I enable the checkbox in the settings of your plugin “Include” by whom is sold “in the store, shopping cart and on the checkout page), then the vendor name in the catalog is displayed incorrectly, due to the settings Topics. Therefore, I have to hide the display that is created when I click the “Include who sells” checkbox and I use the code …
Before updating the plugin, the code that I sent above worked, but after updating the brand display in the catalog (disappeared in the list of products. Please help me, tell me how can I display the vendor name again as in the picture? https://prnt.sc/11akbwf
-
April 13, 2021 at 7:11 PM #119669MVX Support NinjaKeymaster
Hi,
we have checked the code on the previous version of WCMp, but not working. Because you have not added any function with this function name “add_vendor_after_product_title” you are using the name on the hook and also this function is not attached with any other hook – “function add_wcmp_vendor_name()”.Kindly check the code.
Regards,
-
April 16, 2021 at 6:21 PM #119902l.ganParticipant
thanks, I have no more problems on this issue
-
April 16, 2021 at 7:09 PM #119908NerdySupportExpert MoumitaKeymaster
We are closing this thread @l.gan
-
-
AuthorPosts
The topic ‘vendor name’ is closed to new replies.