Home Forums WoodMart support forum Woodmart Product Filter Required Input

Woodmart Product Filter Required Input

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #200573

    scholtobos
    Participant

    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.
    #200615

    Artem Temos
    Keymaster

    Hello,

    You can find the code for these widgets in the file woodmart\inc\shortcodes\product-filters.php. Sorry, but we don’t have instruction on this and can’t guarantee that adding the required attribute will work as you expect.

    Kind Regards

    #200625

    scholtobos
    Participant

    Thanks. I will try.

    I’m trying to find the code piece where the input is defined:
    <input class="result-input" name="xxx" type="hidden" value="">

    I don’t find this back in woodmart\inc\shortcodes\product-filters.php

    Which file do I need?

    #200639

    Artem Temos
    Keymaster

    This input is located in the following file woodmart\inc\widgets\class-widget-layered-nav.php

    #200679

    scholtobos
    Participant

    Seriously? I need the input located for these product filters: https://woodmart.xtemos.com/product-filters/

    Are you using the same file for layered nav AND the product filters you added in WoodMart 2.9?

    #200683

    Artem Temos
    Keymaster

    Yes, it is a correct file with this line https://prnt.sc/stp9v8

    #200685

    scholtobos
    Participant

    Yes, Found it. Thanks.

Viewing 7 posts - 1 through 7 (of 7 total)

The topic ‘Woodmart Product Filter Required Input’ is closed to new replies.