Forum Replies Created
- AuthorPosts
Sushobhan
KeymasterHello,
Have you use my snippet in your themes function.php? Well, the snippet should work. To debug this further I’ll require a temporary access of your site. When sharing the access, please don’t forget to mark the reply as private.
Thanks!March 10, 2020 at 6:26 pm in reply to: Invalid arg supplied for foreach() in class-wp-list-util.php on line 151 #110951Sushobhan
KeymasterHello,
Ideally you should try to solve the issue, not hiding it. You couldn’t tell for sure, what functionality it will break for your website users. These kind of issues mostly happen due to compatibility problem. Make sure all the plugins you use are compatible to each other and also with your version of WP.
Thanks!March 10, 2020 at 6:02 pm in reply to: Multiple Provider Stores that will pay commissions and others that will not. #110948Sushobhan
KeymasterHello,
You can set individual store wise commission from Admin Dashboard >> Store Vendors >> [[Particular vendor]] from there go to Commission & Withdrawal tab and override your global commission settings. For more detail read here [search for Vendor Level Commission]
Thanks!Sushobhan
KeymasterHello,
It seems the product is already published before the code snippet was added. From now on, when you try to add a new product, you will see that you can’t add more than one attribute.
Thanks!Sushobhan
KeymasterThis reply has been marked as private.Sushobhan
KeymasterHello,
in my local setup the code is working fine. I’m sending the full code here, kindly comment out your all existing code and use the following-function register_product_Custom_Type() { class WC_Product_Custom_Type extends WC_Product { public function __construct( $product ) { $this->product_type = 'custom_type'; parent::__construct( $product ); } } } add_action( 'init', 'register_product_Custom_Type' ); function add_product_Custom_Type( $types ) { $types['custom_type'] = __( 'Custom Type', 'custom_product' ); return $types; } add_filter( 'product_type_selector', 'add_product_Custom_Type' ); add_filter( 'wcfm_product_types', 'add_product_Custom_Type', 50 ); add_filter( 'wcfm_capability_settings_fields_product_types', function( $product_types, $handler, $wcfm_capability_options = array() ) { $custom_type = ( isset( $wcfm_capability_options['custom_type'] ) ) ? $wcfm_capability_options['custom_type'] : 'no'; $product_types['custom_type'] = array( 'label' => __( 'Custom Type', 'wc-frontend-manager' ), 'name' => $handler . '[custom_type]', 'type' => 'checkboxoffon', 'class' => 'wcfm-checkbox wcfm_ele', 'value' => 'yes', 'label_class' => 'wcfm_title checkbox_title', 'dfvalue' => $custom_type ); return $product_types; }, 60, 3 ); function get_group_capablity( $userid = '' ) { if ( ! is_user_logged_in() ) return false; if ( ! $userid ) $userid = get_current_user_id(); $wcfm_vendor_groups = get_user_meta( $userid, '_wcfm_vendor_group', true ); if ( $wcfm_vendor_groups && is_array( $wcfm_vendor_groups ) && ! empty( array_filter( $wcfm_vendor_groups ) ) ) { $group_capability_options = array(); foreach ( $wcfm_vendor_groups as $wcfm_vendor_group ) { if ( $wcfm_vendor_group ) { $group_capability_options = array_merge( $group_capability_options, (array) get_post_meta( $wcfm_vendor_group, '_group_capability_options', true ) ); } } return $group_capability_options; } return false; } function _allow_custom_product_types( $product_types ) { $wcfm_capability_options = get_group_capablity(); if ( ! $wcfm_capability_options ) { if ( wcfm_is_vendor() ) { $wcfm_capability_options = get_option( 'wcfm_capability_options', array() ); } elseif ( wcfm_is_manager() ) { $wcfm_capability_options = get_option( 'wcfm_shop_manager_capability_options', array() ); } elseif ( wcfm_is_staff() ) { $wcfm_capability_options = get_option( 'wcfm_shop_staff_capability_options', array() ); } else { $wcfm_capability_options = array(); } } $custom_type = ( isset( $wcfm_capability_options['custom_type'] ) ) ? $wcfm_capability_options['custom_type'] : 'no'; if ( $custom_type == 'yes' && ! current_user_can( 'administrator' ) ) unset( $product_types['custom_type'] ); return $product_types; } add_filter( 'wcfm_product_types', '_allow_custom_product_types', 700 ); function _products_manage_meta_save_offer_type( $new_product_id, $wcfm_products_manage_form_data ) { global $WCFM; if ( $wcfm_products_manage_form_data['product_type'] == 'custom_type' ) { update_post_meta( $new_product_id, 'offer_type_filter', esc_attr( $wcfm_products_manage_form_data['product_type'] ) ); } else { } } add_action( 'after_wcfm_products_manage_meta_save', '_products_manage_meta_save_offer_type', 50, 2 ); function custom_type_downloadable_support( $fields, $product_id, $product_type ) { if ( $product_type == 'custom_type' ) { $is_downloadable = ( get_post_meta( $product_id, '_downloadable', true ) == 'yes' ) ? 'enable' : ''; $fields["is_downloadable"]['dfvalue'] = $is_downloadable; } return $fields; } add_filter( 'wcfm_product_manage_fields_general', 'custom_type_downloadable_support', 10, 3 ); function custom_type_downloadable_tab_data( $fields, $product_id, $product_type ) { if ( $product_type == 'custom_type' ) { $is_downloadable = ( get_post_meta( $product_id, '_downloadable', true ) == 'yes' ) ? 'enable' : ''; if ( $is_downloadable == 'enable' ) { $downloadable_files = (array) get_post_meta( $product_id, '_downloadable_files', true ); $download_limit = ( -1 == get_post_meta( $product_id, '_download_limit', true ) ) ? '' : get_post_meta( $product_id, '_download_limit', true ); $download_expiry = ( -1 == get_post_meta( $product_id, '_download_expiry', true ) ) ? '' : get_post_meta( $product_id, '_download_expiry', true ); } $fields["downloadable_files"]['value'] = $downloadable_files; $fields["download_limit"]['value'] = $download_limit; $fields["download_expiry"]['value'] = $download_expiry; } return $fields; } add_filter( 'wcfm_product_fields_downloadable', 'custom_type_downloadable_tab_data', 10, 3 );Let me know how it goes.
Thanks!Sushobhan
KeymasterHello,
This is the easiest way to check if the problem is coming from WCFM or not. Detecting and isolating the incompatible plugin is in step 2. This would hardly take a minute or two. Still, if you want, share me a temporary access of your site so that I can debug this for you. When sharing the access, please don’t forget to mark the reply as private.
Thanks!Sushobhan
KeymasterHi,
You can change the vendor storefront slug http://………../shop/store/[your_store] to your preference from Settings >> Marketplace Settings, change the Vendor Store URL value to your desired one. Your current WordPress installation folder is named shop, so for now all the link in your site starts with http://………../shop/.
Thanks!Sushobhan
KeymasterHello,
Kindly use the following snippet-add_filter( 'wcfm_attribute_limit', function( $limit ) { return 1; } );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,
There seems to be a plugin or theme conflict. Kindly test this with all other plugins disabled except WooCommerce and WCFM plugins. If the problem persists try changing the theme as well.
Thanks!Sushobhan
KeymasterHello,
Thanks for getting in touch. To make pricing fields mandatory, go to Settings page from Admin dashboard and click on Product Custom Validation. From there you can choose the fields which you want to make mandatory. Please note this feature is a part of our ultimate plugin.
Thanks!Sushobhan
KeymasterHello,
Replace your existing _allow_custom_product_types function with the following code snippet-function get_group_capablity( $userid = '' ) { if ( ! is_user_logged_in() ) return false; if ( ! $userid ) $userid = get_current_user_id(); $wcfm_vendor_groups = get_user_meta( $userid, '_wcfm_vendor_group', true ); if ( $wcfm_vendor_groups && is_array( $wcfm_vendor_groups ) && ! empty( array_filter( $wcfm_vendor_groups ) ) ) { $group_capability_options = array(); foreach ( $wcfm_vendor_groups as $wcfm_vendor_group ) { if ( $wcfm_vendor_group ) { $group_capability_options = array_merge( $group_capability_options, (array) get_post_meta( $wcfm_vendor_group, '_group_capability_options', true ) ); } } return $group_capability_options; } return false; } function _allow_custom_product_types( $product_types ) { $wcfm_capability_options = get_group_capablity(); if ( ! $wcfm_capability_options ) { if ( wcfm_is_vendor() ) { $wcfm_capability_options = get_option( 'wcfm_capability_options', array() ); } elseif ( wcfm_is_manager() ) { $wcfm_capability_options = get_option( 'wcfm_shop_manager_capability_options', array() ); } elseif ( wcfm_is_staff() ) { $wcfm_capability_options = get_option( 'wcfm_shop_staff_capability_options', array() ); } else { $wcfm_capability_options = array(); } } $custom_type = ( isset( $wcfm_capability_options['custom_type'] ) ) ? $wcfm_capability_options['custom_type'] : 'no'; if ( $custom_type == 'yes' && ! current_user_can( 'administrator' ) ) unset( $product_types['custom_type'] ); return $product_types; }Thanks!
Sushobhan
KeymasterThis reply has been marked as private.March 6, 2020 at 12:25 pm in reply to: Remove the virtual and downloadable product check boxes #110220Sushobhan
KeymasterHi Claire,
Yes, its a part of our Ultimate plugin. Sorry I forget to mention that earlier. But, if you want to only hide virtual and downloadable options, you won’t need the ultimate plugin, use the following snippet for that-function disable_virtual_downloadable_support( $general_fields ) { if ( isset( $general_fields['is_virtual'] ) ) unset( $general_fields['is_virtual'] ); if ( isset( $general_fields['is_downloadable'] ) ) unset( $general_fields['is_downloadable'] ); return $general_fields; } add_filter( 'wcfm_product_manage_fields_general', 'disable_virtual_downloadable_support' );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,
You need to use Loco translate to translate those fields. Here is the guide- https://localise.biz/wordpress/plugin/beginners
Thanks!Sushobhan
KeymasterHello,
We have plan for something like this. But as of now, there is none 🙁
Thanks!Sushobhan
KeymasterHello,
Please use the following snippet. Give special attention to ‘wcfm_capability_settings_fields_product_types’ filter and ‘_allow_custom_product_types’ function to see why your code was not working.function register_product_Custom_Type() { class WC_Product_Custom_Type extends WC_Product { public function __construct( $product ) { $this->product_type = 'custom_type'; parent::__construct( $product ); } } } add_action( 'init', 'register_product_Custom_Type' ); function add_product_Custom_Type( $types ) { $types['custom_type'] = __( 'Custom Type', 'custom_product' ); return $types; } add_filter( 'product_type_selector', 'add_product_Custom_Type' ); add_filter( 'wcfm_product_types', 'add_product_Custom_Type', 50 ); add_filter( 'wcfm_capability_settings_fields_product_types', function( $product_types, $handler, $wcfm_capability_options = array() ) { $custom_type = ( isset( $wcfm_capability_options['custom_type'] ) ) ? $wcfm_capability_options['custom_type'] : 'no'; $product_types['custom_type'] = array( 'label' => __( 'Custom Type', 'wc-frontend-manager' ), 'name' => $handler . '[custom_type]', 'type' => 'checkboxoffon', 'class' => 'wcfm-checkbox wcfm_ele', 'value' => 'yes', 'label_class' => 'wcfm_title checkbox_title', 'dfvalue' => $custom_type ); return $product_types; }, 60, 3 ); function _allow_custom_product_types( $product_types ) { $wcfm_capability_options = array(); if(wcfm_is_vendor()) { $wcfm_capability_options = get_option( 'wcfm_capability_options', array() ); } elseif(wcfm_is_manager()) { $wcfm_capability_options = get_option( 'wcfm_shop_manager_capability_options', array() ); } elseif(wcfm_is_staff()) { $wcfm_capability_options = get_option( 'wcfm_shop_staff_capability_options', array() ); } $custom_type = ( isset( $wcfm_capability_options['custom_type'] ) ) ? $wcfm_capability_options['custom_type'] : 'no'; if ( $custom_type == 'yes' && !current_user_can( 'administrator' ) ) unset( $product_types['custom_type'] ); return $product_types; } add_filter( 'wcfm_product_types', '_allow_custom_product_types', 700 ); function _products_manage_meta_save_offer_type( $new_product_id, $wcfm_products_manage_form_data ) { global $WCFM; if ( $wcfm_products_manage_form_data['product_type'] == 'custom_type' ) { update_post_meta( $new_product_id, 'offer_type_filter', esc_attr( $wcfm_products_manage_form_data['product_type'] ) ); } else { } } add_action( 'after_wcfm_products_manage_meta_save', '_products_manage_meta_save_offer_type', 50, 2 ); function custom_type_downloadable_support( $fields, $product_id, $product_type ) { if ( $product_type == 'custom_type' ) { $is_downloadable = ( get_post_meta( $product_id, '_downloadable', true ) == 'yes' ) ? 'enable' : ''; $fields["is_downloadable"]['dfvalue'] = $is_downloadable; } return $fields; } add_filter( 'wcfm_product_manage_fields_general', 'custom_type_downloadable_support', 10, 3 ); function custom_type_downloadable_tab_data( $fields, $product_id, $product_type ) { if ( $product_type == 'custom_type' ) { $is_downloadable = ( get_post_meta( $product_id, '_downloadable', true ) == 'yes' ) ? 'enable' : ''; if ( $is_downloadable == 'enable' ) { $downloadable_files = (array) get_post_meta( $product_id, '_downloadable_files', true ); $download_limit = ( -1 == get_post_meta( $product_id, '_download_limit', true ) ) ? '' : get_post_meta( $product_id, '_download_limit', true ); $download_expiry = ( -1 == get_post_meta( $product_id, '_download_expiry', true ) ) ? '' : get_post_meta( $product_id, '_download_expiry', true ); } $fields["downloadable_files"]['value'] = $downloadable_files; $fields["download_limit"]['value'] = $download_limit; $fields["download_expiry"]['value'] = $download_expiry; } return $fields; } add_filter( 'wcfm_product_fields_downloadable', 'custom_type_downloadable_tab_data', 10, 3 );Thanks!
Sushobhan
KeymasterHi,
Please use Membership Plan page as your registration page [ link- http://www.imnlimited.com/shop/vendor-membership/ ]. As, I can see, You are still using default registration page, that’s why you are not getting the plan selection step.
In your membership settings page, you have chosen a different page for ‘Custom Plan Page’; deselect this value back to ‘–Select a page–‘ and checkout the default flow of registration.Thanks.
Sushobhan
KeymasterHello,
Can you please send me your current membership settings page snapshot? Also send me a link of your site.
Thanks!Sushobhan
KeymasterYou can customize registration fields from Settings >> Vendor Registration page. You can make fields mandatory or add new custom registration fields from there.
Thanks!Sushobhan
KeymasterHello,
I just confirm this flow in my last reply. If you are following my replies, then you must have set Subscription First Step value to Registration and use membership plan page as your registration page. So now, when anyone comes to this page for registration, first the registration form is opened. After they fill their details and go to the next step, there they will see the 3 membership plans to choose from.
Is there anything in my answer that you didn’t get? Let me know!Sushobhan
KeymasterHello,
We are in final phase of implementing this feature. Hopefully within this month you can expect this update.
Thanks!Sushobhan
KeymasterHello,
There is a risk involved in this. For instance, what if vendors try to cheat the marketplace by continually drafting the products once is hits low or nil inventory stock and in that place publish other products. In that case, they will be able to sell more number of products than their allowed product limit.
That’s why we keep it like this.
Thanks!Sushobhan
KeymasterHello,
I guess you created different membership plans ‘Private’ and ‘Business’ for that purpose. Now when a person signup as a vendor, after they fill out registration fields then they will need to select the corresponding membership plan applicable for them.
Do you want something else?
Thanks!Sushobhan
KeymasterHello,
Kindly provide me your code snippet to check. The variable $handler can be used to check for user type. For shop managers the value of $handler is ‘wcfm_shop_manager_capability_options’. So you can add a check on the value if you want to make these capability available for a particular user type.
Thanks!- AuthorPosts