Hi, I have product filters (see attachment) and I need to make sure people select all of the attribute boxes before they can filter. So I need to make the input required (and add some css to make boxes red when not filled in).
I know this requires customisation and I will do it myself. I only need some advise what and where to do.
I know I need to add required in the code like this:
<input type="attribute" id="attribute_name" required>
But I cannot find the file where this happens. I only found woodmart > inc > shortcodes > product filter:
$output = '<form action="' . esc_url( $form_action ) . '" class="woodmart-product-filters' . esc_attr( $classes ) . '" method="GET">';
$output .= do_shortcode( $content );
$output .= '<div class="woodmart-pf-btn"><button type="submit">' . esc_html__( 'Filter', 'woodmart' ) . '</button></div>';
$output .= '</form>';
Unfortunately for me this is not the place where attributes can be made required.
Can you tell me which file I need to modify? Or maybe better, is there a function I can add to functions.php to solve this?
Hope you can give me a hint.
Kind regards,
Attachments:
You must be
logged in to view attached files.