Forum Replies Created
- AuthorPosts
Sushobhan
KeymasterYou are always welcome 🙂
Let me know if there’s anything else we can help you with.
Can we ask for a favor? Would you mind taking a few minutes to review our plugin at https://wordpress.org/support/plugin/wc-multivendor-marketplace/reviews/ and let others know about your 5 Star experience with WCFM Marketplace. Also, follow us on Twitter https://twitter.com/wcfmmp for more exciting news, important updates, and irresistible offers.
November 16, 2019 at 10:57 pm in reply to: how to prevent use of spam mails during registration #92579Sushobhan
KeymasterIf you don’t use any external API’s then you will need to add the restricted email domains manually. Following is a sample code to achieve what you want –
function custom_email_validation($wcfm_membership_registration_form_data, $form) { if($form=='vendor_registration') { $user_email = $wcfm_membership_registration_form_data['user_email']; $email_domain = substr($user_email, strpos($user_email, '@') + 1); $my_domain = str_replace('www.','',parse_url(get_site_url(),PHP_URL_HOST)); //Current website domain $restricted_domains = array($my_domain, 'yopmail.com', 'ymail365.com'); //add all the restricted email websites here foreach($restricted_domains as $domain) { if($domain == $email_domain) return array('has_error' => 'true', 'message' => 'Restricted email host used. Use a different one.'); } } return $wcfm_membership_registration_form_data; } add_filter( 'wcfm_form_custom_validation', 'custom_email_validation', 10, 2);Add this code to your child theme’s functions.php
In case you do not have child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets/
November 16, 2019 at 6:14 pm in reply to: how to prevent use of spam mails during registration #92562Sushobhan
KeymasterYou need to add Disposable email check for that. There are free API’s like https://debounce.io/free-disposable-check-api/. It’s super simple as you only need to make a GET request with the user input email and the response JSON will tell you if it is disposable or not.
You can add this check using ‘wcfm_form_custom_validation’ filter.
November 16, 2019 at 5:58 pm in reply to: SHOW THE CREATE DATE AND YEAR OF THE VENDOR IN VENDOR PROFILE PAGE #92561Sushobhan
KeymasterYou can fetch the creation date of any WordPress user, this includes vendors as well, by the following two lines
$user_data = get_userdata(get_current_user_id()); $registered_date = $user_data->user_registered;The first line is fetching the currently logged in users data and the second line extracts the registration date out of it.
By the way, in which position of the profile page, you want to show this detail?Sushobhan
KeymasterHello,
WCFM allows for the same file extensions defined by WordPress. You can see the full list via WordPress Codex: Uploading Files.
You can add additional allowed extensions by using ‘upload_mimes’ filter. Take a look at the the following sample code –function my_custom_mime_types( $mimes ) { // New allowed mime types. $mimes['ex4'] = 'application/octet-stream'; //mime type of the file goes here $mimes['ex5'] = 'application/octet-stream'; $mimes['mql'] = 'application/octet-stream'; return $mimes; } add_filter( 'upload_mimes', 'my_custom_mime_types' );Add this code to your child theme’s functions.php
In case you do not have child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets/
Note: A quick Google search suggest me the mime type ‘application/octet-stream’. If the above code doesn’t work please check the mime type of each of these extensions from here https://htmlstrip.com/mime-file-type-checker.
Sushobhan
KeymasterThere are two part of the answer-
First, changing strings – You can do that easily using string translation(no coding involved). You can use Loco translate plugin for this purpose. (How to use Loco translate – https://www.youtube.com/watch?v=ZUPhsoUm-QE)
Alternatively, you can override the template file located at:
wc-frontend-manager\views\enquiry\wcfm-view-enquiry-tab.phpSecond, for adding the [Button to contact the vendor] – use the following code to achieve this
add_filter('wcfm_is_pref_enquiry_button', '__return_false');
Add this code to your child theme’s functions.php
In case you do not have child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets/Sushobhan
KeymasterHello,
Sorry for such delayed response. Currently WCFM is not compatible with WP Crowdfunding.
You may reach us here for this – https://wclovers.com/woocommerce-multivendor-customization/
Sorry again for not replying to you sooner.
ThanksSushobhan
KeymasterThe hook ‘wcfm_product_types’ is inappropriate in your case as the new field we are adding here is not a “Product Type” like Simple, Variable, etc. You will not need that code block. Instead modify ‘wcfm_product_manage_fields_general’ hook function in such a way that it consider the capability setting. Please refer to the code below
function add_new_general_field( $fields, $product_id, $product_type, $wcfm_is_translated_product, $wcfm_wpml_edit_disable_element ) { $wcfm_capability_options = get_option( 'wcfm_capability_options', array() ); $is_new_val_cap = ( isset( $wcfm_capability_options['is_new_val'] ) ) ? $wcfm_capability_options['is_new_val'] : 'no'; if($is_new_val_cap=='yes') return $fields; $is_new_val = ( get_post_meta( $product_id, '_is_new_val', true ) == 'yes' ) ? 'enable' : ''; $new_field = array( "is_new_val" => array( 'desc' => __( 'New Value', 'wc-frontend-manager' ), 'type' => 'checkbox', 'class' => 'wcfm-checkbox wcfm_ele wcfm_half_ele_checkbox simple non-booking non-variable-subscription non-job_package non-resume_package non-redq_rental non-accommodation-booking' . ' ' . $wcfm_wpml_edit_disable_element, 'desc_class' => 'wcfm_title wcfm_ele virtual_ele_title checkbox_title simple non-booking non-variable-subscription non-job_package non-resume_package non-redq_rental non-accommodation-booking' . ' ' . $wcfm_wpml_edit_disable_element, 'value' => 'enable', 'dfvalue' => $is_new_val ) ); return array_slice( $fields, 0, 1, true ) + $new_field + array_slice( $fields, 1, count( $fields ) - 1, true ); } add_filter( 'wcfm_product_manage_fields_general', 'add_new_general_field', 9, 5 ); function save_new_field_value( $new_product_id, $wcfm_products_manage_form_data ) { $is_new_val = ! empty( $wcfm_products_manage_form_data['is_new_val'] ) ? 'yes' : 'no'; update_post_meta( $new_product_id, '_is_new_val', $is_new_val ); } add_action( 'after_wcfm_products_manage_meta_save', 'save_new_field_value', 10, 2 ); function wcfmcap_new_field_product_types( $product_types, $handler = 'wcfm_capability_options', $wcfm_capability_options = array() ) { $new_field = ( isset( $wcfm_capability_options['is_new_val'] ) ) ? $wcfm_capability_options['is_new_val'] : 'no'; $product_types["is_new_val"] = array( 'label' => __( 'New Value', 'wc-frontend-manager' ), 'name' => $handler . '[is_new_val]', 'type' => 'checkboxoffon', 'class' => 'wcfm-checkbox wcfm_ele', 'value' => 'yes', 'label_class' => 'wcfm_title checkbox_title', 'dfvalue' => $new_field ); return $product_types; } add_filter( 'wcfm_capability_settings_fields_product_types', 'wcfmcap_new_field_product_types', 60, 3 );Thanks
Sushobhan
KeymasterHi, Please provide us your site access as we could not recreate the issue on our side. Also, don’t forget to mark it as private. Thanks
Sushobhan
KeymasterHello,
At this moment there is no direct way to override “Shipment Tracking” email. Also, you will need to override a template to change the the tracking fields, which is located in –
wc-frontend-manager-ultimate\views\orders\wcfmu-view-shipment-tracking.php
ThnaksSushobhan
KeymasterHi,
Glad it worked out. Coming to the next section, what problem are you facing? Is it not showing under capability page? Or is the value not saving? I might need the full code along with what you want to achieve, to help you out.
ThanksSushobhan
KeymasterPlease provide the Product url as well. I have checked the site but couldn’t find it.
Sushobhan
KeymasterHi,
Please add this code to your site –function disallow_commission_manage_for_managers() { if(wcfm_is_manager()) return false; return true; } add_filter('wcfm_is_allow_commission_manage', 'disallow_commission_manage_for_managers');Add this code to your child theme’s functions.php
In case you do not have child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets/
Thank YouSushobhan
KeymasterPlease provide me the product url and your website credentials to debug the issue. Don’t forget to mark it as private.
Sushobhan
KeymasterHello,
The filter ‘wcfm_product_manage_fields_general’ sends 5 arguments to its callback function. The error can only appear if you pass the last argument as 3 instead of 5.
add_filter(‘wcfm_product_manage_fields_general’, ‘add_new_general_field’, 9, 5);
The remaining two arguments are used for translation purposes and if you are not using WPML you can safely omit those.The code you shares seems okay, what error are you getting? Is it related to your first query? Please explain the whole purpose.
Sushobhan
KeymasterWe need some more information’s to solve this.
1. Is this happening for all the products?
1. Did you delete the owner (vendor) of that product? If yes- then its a known bug and will get fixed in our future update. Meanwhile to solve the issue go to your vendor list (admin dashboard), offline the vendor and then again make him/her online.
2. Please check if you mistakenly set the ‘Disable Add to Cart?’ to true from ‘Catalog Mode’ tab (Product edit screen).
Let us know.Sushobhan
KeymasterCheck the sample code below. Add this code to your child theme’s functions.php
In case you do not have child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets/function add_new_general_field($fields, $product_id, $product_type, $wcfm_is_translated_product, $wcfm_wpml_edit_disable_element) { $is_new_val = ( get_post_meta( $product_id, '_is_new_val', true) == 'yes' ) ? 'enable' : ''; $new_field = array("is_new_val" => array('desc' => __('New Value', 'wc-frontend-manager') , 'type' => 'checkbox', 'class' => 'wcfm-checkbox wcfm_ele wcfm_half_ele_checkbox simple non-booking non-variable-subscription non-job_package non-resume_package non-redq_rental non-accommodation-booking' . ' ' . $wcfm_wpml_edit_disable_element, 'desc_class' => 'wcfm_title wcfm_ele virtual_ele_title checkbox_title simple non-booking non-variable-subscription non-job_package non-resume_package non-redq_rental non-accommodation-booking' . ' ' . $wcfm_wpml_edit_disable_element, 'value' => 'enable', 'dfvalue' => $is_new_val)); $fields = array_slice($fields, 0, 1, true) + $new_field + array_slice($fields, 1, count($fields) - 1, true); return $fields; } add_filter('wcfm_product_manage_fields_general', 'add_new_general_field', 9, 5); function save_new_field_value($new_product_id, $wcfm_products_manage_form_data) { $is_new_val = !empty( $wcfm_products_manage_form_data['is_new_val'] ) ? 'yes' : 'no'; update_post_meta( $new_product_id, '_is_new_val', $is_new_val ); } add_action('after_wcfm_products_manage_meta_save', 'save_new_field_value', 10, 2);Kindly, made the changes as per your requirement before using it on production environment.
Sushobhan
KeymasterSorry I misunderstood your query. Add this code to your child theme’s functions.php
In case you do not have child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets/
add_filter('wcfm_is_allow_vshipping_settings', '__return_false');Sushobhan
KeymasterThere is a settings for that. Go to Capability menu from your admin dashboard and disable ‘Shipping’ under ‘Panels’ section. See image https://ibb.co/Dbgm1tY
Sushobhan
KeymasterFor this, you need to first add the element using ‘wcfm_product_manage_fields_general’ filter, which I think you already figured out. For save use this hook – do_action( ‘after_wcfm_products_manage_meta_save’, $new_product_id, $wcfm_products_manage_form_data );
Sushobhan
KeymasterYou are always welcome 🙂 Let me know if there’s anything else we can help you with.
Sushobhan
KeymasterTo make block cost field mandatory you can use the following code snippet
function make_booking_block_cost_required($fields) { $required = array( 'custom_attributes' => array( 'required' => true, //'required_message' => 'Change default required message from here', ), ); $fields['_wc_booking_block_cost'] = array_merge($fields['_wc_booking_block_cost'], $required); return $fields; } add_filter('wcfm_wcbokings_cost_fields', 'make_booking_block_cost_required');Add this code to your child theme’s functions.php
In case you do not have child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets/
Sushobhan
KeymasterHello @ckaus, it seems you have more specific capabilities set for the vendor. What you set from the dashboard menu “Capability” is the most generic settings, it will be applied by default. Now if you have ‘Group & Staff’ addon installed then you will get the option to set more specific capabilities for each group of vendors, which got precedence over generic capability settings. You can set vendor specific capabilities as well which got the highest priority, from vendor profile.
Please check which capability level you are using and change accordingly. It will work.November 9, 2019 at 6:46 pm in reply to: Wcfm_catalog_enquiry Wcfm_login_popup Show Blank In Store List Page #91567Sushobhan
KeymasterLet us know if you decide otherwise or have some other queries.
- AuthorPosts