WooCommerce Required Default Fields

Support General WooCommerce Required Default FieldsResolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #44755
    ZakirZakir
    Participant

    Hello,

    I have created some custom fields for the WooCommerce Product CPT and I have set those fields to "Required". I want to apply this same functionality to some of the default WooCommerce Product fields on the admin side. I do not want users to be able to publish a product post or even to save a draft of it except that they are prompted to fill in the empty required fields.

    Is Metabox using JQuery for this functionality or is it done via PHP?

    #44761
    PeterPeter
    Moderator

    Hello,

    Regarding the Required field setting, Meta Box adds the required attribute to the HTML input tag. It is validated by the browser. For example:
    <input type="text" required="1" id="text_4cjqazxdoup" class="rwmb-text" name="text_4cjqazxdoup" aria-labelledby="text_4cjqazxdoup-label">

    Regarding WooCommerce fields, please contact WooCommerce support and ask them how to add the required setting to their fields.

    #44766
    ZakirZakir
    Participant

    Thanks! I was able to follow the instructions I found in the following link to make a field mandatory.
    https://www.damiencarbery.com/2018/01/make-weight-a-required-field-in-woocommerce/

    I will continue to apply this knowledge to make other fields mandatory.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.