Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • I manage to make the phone field as required. And share it over here if that is not too late.

    /plugins/woocommerce-catalog-enquiry/classes/class-wc-Woocommerce-Catalog-Enquiry-frontend.php

    add the code under // error levels

    $error_levels['phone_required'] = __('Phone is required field', 'woocommerce-catalog-enquiry');

    /plugins/woocommerce-catalog-enquiry/assets/frontend/js/frontend.js

    add the code under var email = document.getElementById(‘woo_user_email’).value;

    var phone = document.getElementById('woo_user_phone').value;

    find the email validation condition.
    if (email == ” || email == ‘ ‘) {
    document.getElementById(‘msg_for_enquiry_error’).innerHTML = catalog_enquiry_front.error_levels.email_required;
    document.getElementById(‘woo_user_email’).focus();
    return false;
    }

    add the following code under it.

    if (phone == '' || email == ' ') {
        document.getElementById('msg_for_enquiry_error').innerHTML = 
            catalog_enquiry_front.error_levels.phone_required;
            document.getElementById('woo_user_phone').focus();
            return false;
    }
    • This reply was modified 6 years, 1 month ago by madbug.
    Thread Starter madbug

    (@madbug)

    Issue resolved by putting in default:get in Form 2.

    eg.
    Form 1 (Step 1)
    [email* EMAIL placeholder “Your Email” ]

    Form 2 (Step 2)
    [email* EMAIL default:get ]

    Thread Starter madbug

    (@madbug)

    Hi Riaan,
    Thanks for your reply, however, that doesn’t resolve my issue.
    The 1 variation only tide to 1 inventory.
    Now what I want is 2 variation with 1 inventory/stock.
    Color: Red Size: S Stock:50
    Color: Red. Size: M. Stock:100

Viewing 3 replies - 1 through 3 (of 3 total)