• Resolved lvfxbr

    (@lvfxbr)


    Hello again! How I customize the query string of filter?
    I would like to edit this query:

    ?s=mac&post_type=product&filters=price[10_1447]

    to

    ?search=tshirt&price=10,1447&colors=red,white,yellow...

    Is it possible? The plugin have support for friendly URLS like colors/red/blue/yellow instead of ?colors=red,blue,yellow
    Thanks anyway!

    • This topic was modified 5 years, 6 months ago by lvfxbr.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Dmytro Holovnia

    (@dholovnia)

    ?s to ?search – no, this is WordPress default search and changing it will break the functionality in WooCommerce.

    &post_type=product – is required by WooCommerce to understand that this is search for products

    &price=10,1447&colors=red,white,yellow... – could be &pa-price=10,1447&pa-colors=red,white,yellow... in paid version of the plugin from next release when we will add an addon for this kin of url.

    /filters/price/10_1447/color/red-white-yellow/?s=tshirt&post_type=product – available in paid version of the plugin

    First 2 probably you could change by hooking into init and searching for GET[‘search’]. If found copy GET[‘search’] value into the GET[‘s’] and add GET[‘post_type’]=’product’.
    This is most easy way but posts search will not work and your search widget need to redirect to page with ?search='<search phrase>'

    Regards,
    Dima

    Thread Starter lvfxbr

    (@lvfxbr)

    Thanks for Explanation, Dima!
    I will think about which decision I will take.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to customize query string of filter?’ is closed to new replies.