Skip to main content

How to customise the WithWine shop filters and sort order on WordPress

Add options to the WithWine store shortcode to choose which filters show, which filter is selected when the shop opens and the search box. To put products in your own order, use an eCommerce Section product list.

You can change how the WithWine shop works on your WordPress website by adding options to the store shortcode. For example, you can open the shop on red wines, hide the region filter or add a search box.

Choose which filter is selected when the shop opens

Add data_defaultfilter_ followed by the filter name:

  • Wine type: [withwine type='store' data_defaultfilter_winetype='RedWine' /]. Other values: WhiteWine, Sparkling, FortifiedWine, Cider, Champagne, DessertWine, Rosé.

  • Your own product list filter: [withwine type='store' data_defaultfilter_list='LIST ID' /]. The list must have eCommerce Filter ticked. See "How to add a custom filter to your website's shop page".

  • Variety: [withwine type='store' data_defaultfilter_variety='Shiraz' /]. Use the variety name exactly as it appears in the filter.

  • Region: [withwine type='store' data_defaultfilter_region='Barossa Valley' /].

  • Availability: [withwine type='store' data_defaultfilter_availability='availableToBuy' /] shows only products customers can buy.

If a name has an apostrophe in it, use double quotes around it, for example data_defaultfilter_variety="Nero d'Avola".

Show or hide filter sections

Each filter section shows by default. Add any of these with 'false' to hide it:

  • data_sections_winetype='false'

  • data_sections_variety='false'

  • data_sections_region='false'

  • data_sections_availability='false'

  • data_sections_list='false' hides your product list filters.

Add a search box

Add data_sections_textsearch='true' to show a search box in the filters. Change its placeholder text with data_textsearch_placeholder='Search our wines...'.

You can also open the shop with a search already filled in by adding ?textsearch= to the web address, for example yourwebsite.com/shop?textsearch=riesling.

Put products in your own order

To choose the order of products on your shop page, use a product list with eCommerce Section ticked. See "How to show your wines in sections on your website".

  • Products in an eCommerce Section list appear first, under the list's Section title, in the order you set in the list.

  • If you have more than one eCommerce Section list, the Sort index decides which section comes first.

  • All other products appear after the sections.

Sort the remaining products

data_sort sorts the products that aren't in an eCommerce Section list. Use producttype, name, price, availability or id, and add desc to reverse the order. For example:

[withwine type='store' data_sort='name desc' /]

Example

A "Red wines" page that opens on red wine, hides the wine type and region filters and has a search box:

[withwine type='store' data_defaultfilter_winetype='RedWine' data_sections_winetype='false' data_sections_region='false' data_sections_textsearch='true' /]

Related articles

Did this answer your question?