Mandatory fields in product edit screen

Multi Vendor Marketplace Plugin | WCFM Marketplace Forums WCFM – Ultimate Mandatory fields in product edit screen

This topic contains 5 replies, has 4 voices, and was last updated by Avatar Sushobhan 1 month ago.

  • Author
    Posts
  • #88786
    Avatar
    Zeljo
    Participant

    Hello,

    I would like to make the price mandatory in the product edit screen, is this possible? What I want to do is to remove the ability for someone to add free products.

    Thanks

  • #90284
    Avatar
    Zeljo
    Participant

    No support for paid plugin? Where can I get my money back?

  • #90303
    Avatar
    sdel_nevo
    Participant

    Hi

    I beleave you can set this in the product custom validation area in the settings section

    Not sure if that’s enabled with WCFM Ultimate or the groups and staff plugin to be honest, I’ve got both and can’t remember which one had this capability,

    Steve

  • #90811
    WCFM Forum
    WCFM Forum
    Keymaster

    HI,

    I would like to make the price mandatory in the product edit screen, is this possible?
    – Yeah right, you may set this from WCFM Admin Setting -> Product Custom Validation – https://ibb.co/XxxC7br

    Thank You

  • #91487
    Avatar
    Zeljo
    Participant

    This does not work, I’ve checked the validation for the price, but it still does not validate it. But, it doesn’t matter, because due to the integration with WooCommerce Booking, I need to make the _wc_booking_block_cost mandatory. This is the Block cost, and I need to validate this, how can this be done? IS there a filter for this?

    Thanks

  • #91580
    Avatar
    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/

You must be logged in to reply to this topic.