• Resolved westefan

    (@westefan)


    Hi,
    is it possible to restrict search form (shortcode) to specific categories?
    (similar to cars list shortcode)
    Or to change category choice from dropdown to a image choice?
    Thanks

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author e4jvikwp

    (@e4jvikwp)

    Hi,

    Thanks for the detailed request. Unfortunately, the “Search Form” shortcode does not accept any parameters or filters to render the layout differently. This means that forcing the search over a specific category ID isn’t possible, I’m sorry.

    As you may have noticed, if categories are enabled, then that Shortcode will actually display a drop down menu for the users to select a specific category ID, but it’s a free choice, an optional filter.

    If you were to create an override to display a hidden input value with the ID of the category you want to force, then you would be stuck with that specific category ID and the same Shortcode could not be used in any other way, maybe with a different category ID because you have forced the source code through an override.

    The only valid solution would be adding a new parameter to that Shortcode, but at the moment this is not available. We may add it with the next updates.
    However, please do not forget that the widget “Search Form” (not the Shortcode) has got that exact parameter you need. You can always consider to use the widget instead of the shortcode, and maybe make the widget point to that shortcode to keep the URL you prefer.

    We hope this helps!

    The VikWP Team

    Thread Starter westefan

    (@westefan)

    Hi,
    thanks for your quick response! The widget solution would be perfect, but it doesn’t work. After entering the dates and click on search I return to search form. Maybe you can look at https://dev.abschleppen-bergen.at/vermietung/? Or is it a Pro functionality?
    Best regards

    Plugin Author e4jvikwp

    (@e4jvikwp)

    Hi,

    This is not a Pro functionality at all, the widget is simply missing a page to be used for the action of your form, hence to calculate the landing page.

    You should edit the parameters of your widget (either from the Appearance – Widgets native page of WordPress or by using the page-builder plugin that is currently rendering the widget), and right where you saw the param “Force Specific Category”, you will find also a parameter called “Page”. This must be set to a Shortcode of Vik Rent Car connected to an existing page/post, even the Shortcode you “Search Form” you were testing on your first message.

    In short, that parameter “Page” of your widget must not be empty, it must be set to an existing Shortcode of Vik Rent Car properly configured, and that URL will then be used to parse the routing URL for the reservation process.

    Best regards,
    The VikWP Team

    Thread Starter westefan

    (@westefan)

    Hi and thanks again!
    I guess I understand the principle now.
    Another question: I’ve set the widget VikRentCar Cars on https://dev.abschleppen-bergen.at/home/baumaschinenvermietung/ with a filter by category “Baumaschinen” but I get a list with all categories. What’s wrong with my settings?
    Best regards
    Stefan

    PS: I’m sure I will buy Pro version

    Plugin Author e4jvikwp

    (@e4jvikwp)

    Hi Stefan,

    The link you gave us is no longer displaying the search form widget, maybe you removed it or you changed page. In any case, when the widget parameters are forcing a specific category ID, you can easily find this hidden input field within the HTML source code of the widget.
    If you use the browser inspector tool, you can easily check what elements that form contains. If you are sure that the parameters of the widget are properly set, then all we can suggest is to look at the Configuration page in the main plugin Vik Rent Car, to make sure Categories are enabled, as it may be required to enable them before being able to force one.

    Best regards,
    The VikWP Team

    Thread Starter westefan

    (@westefan)

    Hi and sorry, my fault: I didn’t check the widget setting for ordering and filtering. Now it works.
    Best regards

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

The topic ‘Search Shortcode’ is closed to new replies.