WC Lovers

WooCommerce Frontend Manager - Multivendor marketplace vendor dashboard

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

Forum Replies Created

Viewing 25 posts - 1,001 through 1,025 (of 1,046 total)
  • Author
    Posts
  • in reply to: Custom Simple Type Options #92751
    Sushobhan
    Keymaster

    You 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.

    in reply to: how to prevent use of spam mails during registration #92579
    Sushobhan
    Keymaster

    If 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/

    in reply to: how to prevent use of spam mails during registration #92562
    Sushobhan
    Keymaster

    You 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.

    Sushobhan
    Keymaster

    You 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?

    in reply to: Allow custom type file upload #92559
    Sushobhan
    Keymaster

    Hello,
    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.

    in reply to: Inquiries Tab message #92549
    Sushobhan
    Keymaster

    There 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.php

    Second, 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/

    in reply to: WCFM intergration with WP Crowdfunding #92547
    Sushobhan
    Keymaster

    Hello,
    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.
    Thanks

    in reply to: Custom Simple Type Options #92538
    Sushobhan
    Keymaster

    The 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

    in reply to: Upgrading membership keeps the old subscription #92494
    Sushobhan
    Keymaster

    Hi, 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

    in reply to: Email Templates for Shipping in WCFM Ultimate #92453
    Sushobhan
    Keymaster

    Hello,
    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
    Thnaks

    in reply to: Custom Simple Type Options #92448
    Sushobhan
    Keymaster

    Hi,
    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.
    Thanks

    in reply to: Add to cart #92437
    Sushobhan
    Keymaster

    Please provide the Product url as well. I have checked the site but couldn’t find it.

    in reply to: capability 'edit commissions' for managers #92332
    Sushobhan
    Keymaster

    Hi,
    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 You

    in reply to: Add to cart #92309
    Sushobhan
    Keymaster

    Please provide me the product url and your website credentials to debug the issue. Don’t forget to mark it as private.

    in reply to: Custom Simple Type Options #92178
    Sushobhan
    Keymaster

    Hello,
    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.

    in reply to: Add to cart #91999
    Sushobhan
    Keymaster

    We 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.

    in reply to: Custom Simple Type Options #91996
    Sushobhan
    Keymaster

    Check 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.

    in reply to: Hide Shipping tab from settings #91991
    Sushobhan
    Keymaster

    Sorry 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');

    in reply to: Hide Shipping tab from settings #91818
    Sushobhan
    Keymaster

    There 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

    in reply to: Custom Simple Type Options #91806
    Sushobhan
    Keymaster

    For 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 );

    in reply to: Admin's Settings Dashboard not responding #91793
    Sushobhan
    Keymaster

    You are always welcome 🙂 Let me know if there’s anything else we can help you with.

    in reply to: Mandatory fields in product edit screen #91580
    Sushobhan
    Keymaster

    To 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/

    in reply to: Remove email and social media from store #91571
    Sushobhan
    Keymaster

    Hello @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.

    Sushobhan
    Keymaster

    Let us know if you decide otherwise or have some other queries.

    in reply to: Unable to translate menu items with WPML #91560
    Sushobhan
    Keymaster

    @JuanCarlosNavarro – Did it solve the issue? Let me know.

    @adrian
    .petcu2011 – Which plugin are you using, Loco or WPML? Please send me the link of the page where you facing the issue.

Viewing 25 posts - 1,001 through 1,025 (of 1,046 total)