WooCommerce AJAX Products Filter

For Users

Installation of Paid Version

Plugin installation Method 1:

  1. Download the plugin using your BeRocket account.
  2. Disable FREE version of the plugin.
  3. Open the Admin Bar of your site and go to Plugins Add new Upload plugin.
  4. Click on Browser Dialog to open it, select downloaded zip-file, and click on Install.
  5. Click on Activate.

Plugin installation Method 2: 

  1. Download plugin using your BeRocket account.
  2. Disable FREE version of that plugin.
  3. Access your website using FTP.
  4. Go to WordPress/wp-content/plugins folder.
  5. Open downloaded zip-file to unzip its content and copy unzipped files to WordPress/wp-content/plugins folder.
  6. Open the Admin Bar of your site and go to Plugins.
  7. Find Plugin and click on Activate.

Product Key

BeRocket Product key uses for auto update plugins from BeRocket site.

Where could I find a Plugin key?

  1. Open BeRocket site to sign in (for accessing your account press Login button available in the top navigation menu bar)
  2. Go to My Account (press My Account button available in the top navigation menu bar)
  3. Click on the key icon located to the right from WooCommerce AJAX Products Filter plugin name
  4. You may click on Plugin key to copy it
  5. Use the left dialog window to enter any comment for that key and then click on Ready button to save it
  6. What do I need the product key for?

How could I activate a Plugin key?

  1. Copy a Plugin key from BeRocket website
  2. Paste it into WooCommerce AJAX Products Filter entry field
  3. Click on Test button
  4. It the proper Plugin key is entered, you’ll se
  5. Press the Save Changes button

How do I add a new filter?

Open the administration panel of your site and follow BeRocket->Products Filter->Filters

Click on the Add Filter button

Type the name of the filter for your widget

Select the Widget Type that you need

Choose the needed Attribute and Value(only for Widget Type Filter)

Choose the needed Style settings

Choose Additional Settings that you need

Click on the button Save Filter

Follow the link to find more about Filter Settings

Groups Creation

Open the administration panel of your site and follow BeRocket -> Product Filters -> Groups

Click the Add Filter Group button

Select the desired settings and click the Save button

You can find a description of the settings here

How do I check filter problems?

If filters are not output on the page, go to the additional panel on the top admin panel to find the problem.

This panel is displayed on the front pages of the site.

The panel displays the ID of filters and groups, which are links to the filter and group editing page.

When you hover over the ID, you will also see the name of the filter/group and detailed information about the output.

Menu item is not displayed on the page

If the menu item is not displayed on the page, it means that there are no filters for the output on the page or the filters are output incorrectly:

  • Check that filters are added to the page using a widget or a shortcode.
  • Try to output any other widget or shortcode in the same place to check that everything works correctly on the theme side.

Filter is displayed as Empty options

If the filter is displayed as Empty options, it means that the filter is configured incorrectly and there are no settings.

  • Check the filter or group settings.
  • If there are cache plugins on the site, you need to clear the entire cache on the site.
  • Try to create a new filter with the same settings.

Filter/group is displayed as Disabled

If the filter/group is displayed as Disabled, it means that the filter is disabled by the user.

  • On the page with all filters/groups on the disabled filter, click Enable.
  • Disable the Disable all filters option in the plugin settings on the Advanced tab.

Filter/group is displayed as Condition restriction

If a filter/group is displayed as Condition restriction, it means that the page does not meet the conditions that are configured for that filter/group.

  • Open the filter/group editing page and change the display conditions.

Filter displayed as Displayed empty

If the filter is displayed as Displayed empty, it means that the filter is displayed on the page, but there is no data to display and therefore it is empty.

  • Filter cannot find products on the page. You can find out more about errors on the page in the Status block.
  • Products on page have no attribute values for this filter.
  • Filter uses an attribute, which has no values.

Status

Block with data about the current page. Shows the interaction of the plugin with products on the page. It is possible to define the correctness of plugin settings and product output on the page.

  • Is WC page – shows whether the current archive page for WooCommerce products.
  • Shortcode – shows whether the page has a shortcode WooCommerce for displaying products or any other block that uses the mechanisms of WooCommerce shortcode (product modules page constructors: Divi Builder, Elementor, WPBakery Page Builder and others).
  • Products – shows whether the products are defined on the page or not.
  • Pagination – shows whether the pagination is defined on the page or not.

What may be the problem, how to know from the Status block and how to solve it?

Products are not defined on the page

Products are not marked, which means that the block with products is not defined on the page.

  • Check if the products are displayed on the page.
  • If the products are displayed on the page, you need to install the correct Selectors for the products.

This is the archive page of WooCommerce products, but the products are not filtered.

There are several reasons why products are not filtered on the WooCommerce products archive page.

  • The page has been changed by the page constructor (Divi Builder, Elementor or others). In this case, for the module that outputs products, you need to enable the Apply BeRocket AJAX Filters option for supported constructors or add a short code [brapf_next_shortcode_apply] in front of the module to output products.
  • WooCommerce shortcode is used instead of product output. In this case it is necessary to add berocket_aapf parameter (for example: [products limit=”8″ category=”hoodies” paginate=”true” berocket_aapf=”true”]).
  • If the previous steps do not help, then try to change the theme to the standard WordPress theme and check if everything works correctly, then contact the developers of the theme to solve the problem.

Several product blocks are defined on the page

If there are several blocks with products on the page, it means that the page has several blocks that correspond to the products selector.

  • If two blocks with the same products are output, then everything should be working correctly and there is no need to change anything.
  • If one block with products is output on the page that should be filtered, you must install the correct selectors for the products. The selectors must be unique, unfortunately, auto selectors can’t find everything correctly, so you have to enter them manually.

There is no page numbering

Pagination is not marked, so the block with page navigation is not defined on the page.

  • If you have all the products on one page and other products don’t load, then everything is fine.
  • If you have page numbering, you need to specify Selectors correctly.
  • If you have a product load button or endless loading while scrolling through a page, then you may need to configure it further. You can find out more from the plugin or theme developer where the product load button or endless load is being used.

Products are defined by the plugin, but are not filtered

In most cases, Is WC page and Shortcode will not be marked, which means the products are not defined on the server side.

  • A block is used from any page constructor, but such a block is not supported by our plugin, and the developers of the block have not added the necessary hooks from WooCommerce. Use a different block or WooCommerce shortcode.
  • Custom output of products is used on the page.

If Is WC page is marked and Shortcode is not marked, then products on the page have been replaced.

  • Page constructor is used, which replaces the store/category/attribute page and does not use WooCommerce requests for this page. The plugin is compatible with most popular page constructors. Enable the following settings in the module/block with products Apply BeRocket AJAX Filters.
  • WooCommerce [products] shortcode is used on the store/category/attribute page. It is necessary to add the parameter berocket_aapf=true to the shortcode [products berocket_aapf=true].
  • The code on the page has been replaced by a custom one and the WooCommerce page request is not used. It is necessary to apply filters with additional code.

Errors on page load or filtering

If critical errors occur, an exclamation mark will appear next to the “Products Filters” caption. Such errors cause the filters to malfunction and need to be fixed. There are several errors that the plugin can detect.

Same filters with ID *** added multiple times to the page

This message appears if the exact same filter is added twice on page. This may occur if the filter is added twice on the page in different positions, or if the theme duplicates the filter to be output on different devices. Each filter will be output on the page only once, all other filters will be removed.

  • Leave only one filter on the page. It doesn’t matter if one filter or a group is output. Even if you add the exact same filter to two different groups, it will be output only once.
  • If you need to output filters in different positions on desktops and mobile devices, then create two different groups and enable the appropriate options for setting Hide this group on (desktop/mobile/tablet).
  • If there’s only one filter on the page, but the error still appears, the reason is that the theme or page editor is duplicating the panel where you are outputting the filter. Try placing the filter in a different position or using a different module to display the filters.

Multiple filters with taxonomy ****** added to the page

This message appears if you have several filters added to the page for the same attribute or taxonomy with different styles that do not work together. You have several filters added to the page that may affect each other’s functionality.

  • You should leave only one filter per page.
  • If you need to output filters in different positions on desktops and mobile devices, create two different groups and enable the appropriate options for setting Hide this group on (desktop/mobile/tablet).

New page has another quantity of blocks with selector ******

The error may appear after filtering if the number of blocks is displayed differently on the current page and the page after filtering. 

  • If you’re using a page editor, and there appears an error on the page you’ve configured with the help of that editor, try checking the filters on standard WooCommerce pages.
  • It is possible that the selectors that are configured in the plugin are not unique to the products, try to find a unique selector to the products that are supposed to be filtered.

Page has products that will be filtered, but products selector is incorrect

The plugin has detected products for filtering, but won’t be able to replace them on the page without refreshing it, because the selectors are set incorrectly.

  • You need to change the Products Selector settings (plugin settings > Tab Selectors) to the one that will work for your theme. Learn how to choose the correct selector with the developer tools in your browser on the product page.

Settings

General

  • The number of Attribute Values – the number of values, which will be displayed in the widget. Other values can be found by clicking on the button Show values. The Hide the Show/Hide value(s) setting must be disabled
  • Scroll Top – scrolls the page back to top; after filtering, the page will be scrolled to the top with a margin in pixels specified in the field
  • Values count and output – recounts and outputs values of categories/ attributes/ tags/ etc. for filter widgets:
    • All non-empty values are displayed; standard recounting is applied
    • All empty values are removed based on page (categories/tags/ etc.)
    • All non-empty values are displayed; filters are applied in recounting attribute values
    • All empty values are removed based on page (categories/tags/ etc.); filters are applied in recounting attribute values; all empty values based on applied filters will be hidden
    • Filters are applied in recounting attribute values; empty values are removed on the server-side
  • Hide values:
    • Hide values without products – all attribute/category values will be hidden in filters with no products after filtering (the Show/Hide value(s) button will be output; by clicking on this button you will find Hidden values without products)
    • Hide selected values – all attribute/category values will be hidden in the filter widgets used in filtering (the Show/Hide value(s) button will be output; by clicking on this button you will find Hide selected values)
    • Hide empty widgets – some widgets will be hidden after filtering, if there are no products with such attributes/categories in those widgets
    • Hide the Show/Hide value(s) button in filters – hides the Show/Hide value(s) button; it is possible to enable it only when Hide values without products and Hide selected values are also enabled
  • Hide out of stock variations – Disabled, Enabled, Controlled by “Out of stock” filter
    • Hide variable products, if variations with selected filters are out of stock: 
      • Use the option for attribute values, to display a more accurate count using Values count and output option
      • Fix issue with WPEngine request (works with other hostings only if they limit the size of the request)
  • Display variation data:
    • Image – displays a picture of the variation, which matches the filter criteria, on a variable product after filtering
    • Price – displays the price of the variation that matches the filter criteria
  • Remember variation options – after filtering, when opening a variable product, the attributes by which the filtering was performed will be selected
  • Use variation options only after the search

Elements

  • Elements position – the positioning of all elements, which will be output with the help of WooCommerce hooks. If there are no hooks, elements may be not output
    • WooCommerce description (in the header)
    • Before WooCommerce Shop Loop – Before Products
    • After WooCommerce Shop Loop – After Products
  • Display selected filters – show selected filters over products
    • Hide the area of the selected filters if nothing is selected (affects only the area above the products)
  • Show the number of products before filtering – this option works only if you click on the Products Filter button. A tooltip will be output where you can see the number of products which will be output after clicking on the Products Filter button. Start filtering by clicking on the Show button in the tooltip (can’t be used if Hide selected values is enabled)
  • Elements over products – allows you to add Group Filters above all products

Selectors

  • Get selectors automatically uses the script, which automatically searches for selectors in your theme, and then automatically places them in the selectors fields (may function not properly with certain themes). Three products and one category will be created to place selectors. These products and a category will be deleted after selectors are placed
  • Products Selector – A selector for a tag that contains products. Do not change it if you do not know what it is
  • Products Quantity Selector – a selector for a tag from the results of the quantity of products (“Showing 1–8 of 61 results”). Do not change it if you do not know what it is
  • Products Sorting Selector – selector for the sorting block. Do not change it if you do not know what it is
  • Products Pagination Selector – A selector for a tag that contains products. Do not change it if you do not know what it is

SEO

  • Refresh URL when filtering – if this option is enabled, the URL will be changed when selecting / changing the filter
    • Use links for checkboxes and radio filter – in widgets, makes a category/attribute name a link that search bots can index:
      • Use noindex for links – noindex tag will be added to links
      • Use nofollow for links – nofollow tag will be added to links
    • Use slug in URL – use attribute slug instead of its ID. Do not use such symbols as “-“, “_”, “+”, “*”, “№”, etc. in slug
    • Nice URLs – works only with the SEO-friendly URLs. WordPress permalinks should be linked to the Post Name (custom structure: /%postname%/)
    • URL decoding – decrypts characters in a URL to avoid server-side errors
  • Base Canonical URL – use the canonical tag without filters on WooCommerce pages
  • SEO Meta, Title
    • SEO Elements – you can select the elements that SEO Meta and Titles will be used for
      • Title
      • Header
      • Description
    • SEO elements structure – you can select the structure of the selected filters construction
      • {title} with [attribute] [values] and [attribute] [values]
      • {title} [attribute]:[values];[attribute]:[values]
      • [attribute 1 values] {title} with [attribute] [values] and [attribute] [values]
      • {title} – [values] / [values]

Advanced

  • Products per page – sets the number of products on page
  • Display products – always displays products, when filters are selected. Use the option when have categories and subcategories on the pages of your shop, and you want to display products when filtering
  • Use Taxes in Price Filters – allows you to use taxes in the price filter widget and the price range; the option works only for “Standard rates”
  • Page same as filter – on the pages of category/tag/filter attribute the value for a filter will be removed, or only one value will be left
    • Default – all values will be output in the filter widget
    • Delete value – deletes selected value in the filter widget
    • Leave only one value – deletes all values in the filter widget
  • Data Cache – allows you to choose the caching option for filters
    • Disabled – disables filter caching
    • WordPress Cache – uses WordPress Caching
    • Persistent Cache Plugins – uses other plugins for caching (e.g. W3 Total Cache, WP Super Cache)
  • Disable all filters – if you want to hide filters without losing the current configuration, just disable them.
  • Disabled admin bar – Disable panel in WordPress Admin Bar
  • Purge cache – clears the attribute/custom taxonomy cache for plugin. 
  • Display styles only for pages with filters – adds styles only for pages with filters
  • Fix for site with AJAX – fixes for sites that uses AJAX
  • Fix for a search page – disables redirecting, when a search  returns only one product
  • Slider has many values – enable the setting if the slider has more than 250 values. Hierarchical taxonomy may not work correctly with sliders
  • Select2 CSS – fixed CSS styles for Select2 (do not enable, if Select2 works correctly. The option may break Select2 in other plugins or themes)
  • Fix WPEngine query issue – can also work with other hostings if they limit query size.

Design

  • Loading icon – allows you to upload an image for the download animation
  • Loading icon text – text and its position when loading products: 
    • Above – above the loading icon
    • Below – below the loading icon
    • Before – before the loading icon
    • After – after the loading icon
  • Show and hide description – settings for Show and hide descriptions:
    • Open on:
      • click
      • hover
    • Hide on:
      • clicking anywhere
      • cursor is outside the icon
  • Style for number of products – style of counting products
  • Indent for hierarchy in Drop-Down:
    • space
    • 2 spaces
    • Tab
  • Collapse Button style – choose the Open Sidebar button style/filters dropdown [maximization]
  • Collapse Button Icon style – choose an icon for the button
  • Sidebar Shadow – choose the shadow style on opening the sidebar
  • Filters Description
  • Color/Image Tooltip Name
  • Products Count Before Update – tooltip style with the product count before filtering
  • Title – allows you to customize the display styles on the shop pages for Filter Name
  • Title when opened – allows you to customize the display styles on the shop pages for Filter Name when opened
  • Filter – allows you to customize the display styles on the shop pages for a filter when the filter is open

JavaScript/CSS

  • Disable Font Awesome – Don’t loading css file for Font Awesome on site front end. Use it only if you doesn’t uses Font Awesome icons in widgets or you have Font Awesome in your theme
  • Font Awesome Version – Version of Font Awesome that will be used on front end. Please select version that you have in your theme
  • Before Update – a field for executing Javascript before filtering
  • During Update – a field for executing Javascript during filtering
  • After Update – a field for executing Javascript after filtering
  • Custom CSS Style – custom CSS field

Add-ons

Additional Tables (BETA)

Additional tables (BETA) – when the add-on is enabled, new tables for the variable products will be created. It makes filtering of the variable products faster. New tables will be created to make the hierarchical taxonomies faster.

Nested Filters (BETA)
Nested filters (BETA) – when the add-on is enabled, it is possible to set conditions for outputting the selected filter only after filtering by attributes.

Read More

Link like WooCommerce (BETA) – when you turn on add-on, your links after filtering will be like Woocommerce

Read More

Custom Sidebar
When the add-on is enabled, the BeRocket AJAX Filters sidebar will be added. It is possible to add AAPF Filter Single and AAPF Filters Group widgets to the sidebar

Read More

Add-on to modify how filter with Widget type set to Search Field work

Read More

Custom Slug (BETA)
Add-on replace attribute/taxonomy slug in filtered URL. Provide possibility to use multiple filters for same attribute/taxonomy

Read More

Conditions

Conditions – settings under which filters will be displayed on the pages. Conditions can be set in the filters and groups settings

Hide this filter on – hide the filters for devices

  • Mobile – hide the filter on mobile devices
  • Tablet – hide the filter on tablets
  • Desktop – hide the filter on personal computers

Page ID

In the Conditions for Page ID, you can choose on which pages to display filter widget(s)

If you select Equal, widget(s) will be displayed on the selected pages
If you select Not Equal, the widget(s) will not be displayed on the selected pages

Product Category

In the Conditions for the Product Category, you can choose on which categories to display filter widget(s)

If you select Equal, widget(s) will be displayed on the pages of the selected categories
If you select Not Equal, widget(s) will not be displayed on the pages of the selected categories

Product Attribute

In the Conditions for the Product Attribute, you can choose for which pages, attributes or tags to display the widget(s)

If you select Equal, widget(s) will be displayed on the selected attribute or tag pages
If you select Not Equal, the widget(s) will not be displayed on the selected attribute or tag pages

Product Search Page

In the Conditions for Product Search Page, you can choose to display filter(s) on products search page or not

If you select Equal, widget(s) will be displayed on the products search page
If you select Not Equal, the widget(s) will not be displayed on the products search page

Filter settings

Filter

The Filter widget displays filters by Attribute, Tags, Product Subcategories, Custom Taxonomy, Stock Status, Date, Sale Status, Product Category, Rating, Brands

Filter by:
  • Price – filter output by price.
  • Attributes – filter output by attribute.
  • Tags – filter output by tag. 
  • Custom Taxonomies – filter output by custom taxonomies. 
  • Availability – filter output of availability in stock. 
  • Date – filter output by date. 
  • Sale – filter output by discounts. 
  • Product categories – filter output by categories.
  • Rating – filter output by rating. 
  • Brands – filter output by brands (only for brands with Brands for WooCommers plugin).
Operator
  • AND – used to display products with all selected attributes
  • OR – used to display products with at least one of the selected attributes
Value Sorting
  • Default – default sorting
  • Alphabetical – sort alphabetically
  • Numeric – sort by numbering
Sorting type
  • Ascending
  • Descending

Settings for filter Price

Attribute and Values

  • Limit filter values by products from selected category – vilter values will be taken from the category you select in this setting

Advanced

  • Setting values for Price Range – this setting allows you to specify values for the Price Range(only for Style – Price Range and Price Range Select)
  • Price Range Display Options allows you to select one of the price display options from the list(only for Style – Price Range and Price Range Select)
  • Hide first and last ranges without products if the first and last range has no products, they will be hidden when this option is enabled(only for Style – Price Range and Price Range Select)
  • Replace the last range value with an infinity symbol – an infinity symbol will be displayed instead of the last price in the range. You can type another symbol instead of the infinity symbol(only for Style – Price Range and Price Range Select)
  • Enable minimization option – when the setting is enabled, widget can be minimized: 
    • Disable – widget can’t be minimized
    • Enabled with arrow arrow for minimizing widgets will be displayed in   a widget
    • Enabled without arrow arrow for minimizing widgets will not be displayed in widgets, but the widget can still be minimized
    • Enabled without arrow on mobile – arrow for minimizing widgets will not be displayed in widgets on mobile, but the widget can still be minimized
    • Minimize the widget on load? – if the option is enabled, the widget will be minimized on page load
  • Single Selection. Only one value can be selected at a time – if the option is enabled, only one value of the Price Range can be selected(only for Style – Price Range and Price Range Select).
  • Show products count per attribute value? – when the setting is enabled, the number of products will be displayed with each filter value(only for Style – Price Range and Price Range Select)
  • The number of Attribute values – the number of values of Price Range, which will be displayed in the widget; other values of Price Range  can be seen by clicking on “Show value(s)”. Setting Hide the Show/Hide value(s) button in filters must be disabled(only for Style – Price Range and Price Range Select)
    • Show/Hide button – By default, Always visible, Always hidden.
  • Enable Slider input fields – enables fields for manual input “from” and “to”(only for Style – Slider)
  • Use custom values (comma-separated) – allows you to type values by which the price slider will switch(only for Style – Slider and New Slider)
  • Use custom minimum price – allows you to set the minimum price displayed in the price slider(only for Style – Slider and New Slider)
  • Use custom maximum price – allows you to set the maximum price displayed in the price slider(only for Style – Slider and New Slider)
  • Text before Slider value – allows you to type text or a special symbol before the value in the slider(only for Style – Slider and New Slider)
  • Text after Slider value – allows you to type text or a special symbol after the value in the slider(only for Style – Slider and New Slider)
  • Use specific number style:
    • Thousands separator – allows you to set the thousands separator for the filter Price
    • Decimal separator – allows you to set the decimal separator sign for the filter Price
    • Number Of Decimal – allows you to set the number of digits after comma for the filter Price
  • Advanced
    • Description – allows you to add a tooltip with description for the widget
    • CSS class – allows you to set a CSS class for the widget
    • Icon Before Title – allows you to upload a picture or select Font Awesome to be displayed before the Filter Name
    • Icon After Title – allows you to upload a picture or select Font Awesome to be displayed after the Filter Name
    • Icon Before Value – allows you to upload a picture or select Font Awesome to be displayed before the filter value
    • Icon After Value – allows you to upload a picture or select Font Awesome to be displayed after the filter value

Settings for the filter by Attribute, Tag, Custom taxonomies, Product Categories

Attribute and Values

  • Display only child of – allows you to select the output of One/All/Parent/Child attributes/tags/custom taxonomies/categories
  • Limit filter values by products from the selected category – filter values will be taken from the category that you select in this setting
  • Display only selected values/ Remove selected values – allows you to select the attributes/tags/custom taxonomies/categories to output or not to output in the filter

Required Options

  • Color pick – allows you to select one or more colors for attribute/tag/custom taxonomies/categories values instead of the name in the filter(only for Style – Color)
  • Image pick – allows you to choose a picture for attribute/tag/custom taxonomies/categories values instead of the name in the filter. You can upload a picture or select Font Awesome(only for Style – Image)

Additional

  • Hierarchical – allows you to select the output option for the attributes/tags/custom taxonomies/categories tree:
    • Disable – if the value is selected, attributes/tags/custom taxonomies/categories will not be displayed as treeview
    • Display hierarchy – if the value is selected, attributes/tags/custom taxonomies/categories will be displayed as treeview
    • Show hierarchy and hide child – if the value is selected, attributes/tags/custom taxonomies/categories will be displayed as treeview; child categories will be minimized
  • Enable collapse option – if the setting is enabled, widget can be minimized:
    • Disable – widget can’t be minimized
    • Enabled with arrow- arrow for minimizing widgets will be displayed in a widget
    • Enabled without arrow – arrow for minimizing widgets will not be displayed in widgets, but the widget can still be minimized
    • Enabled with arrow on mobile – arrow for minimizing widgets will not be displayed in widgets on mobile, but the widget can still be minimized
    • Minimize the widget on load? – if the option is enabled, the widget will be minimized on page load
  • Single Selection. Only one value can be selected at a time – if the option is enabled, only one value can be selected in the filter. Disable the option if you wish to select more values
  • First Element Text – allows you to type text which will be displayed in the Select style filter(only for Style – Select)
  • Use as numeric – use the slider for numbers; name should be numeric(only for Style – Slider and New Slider)
  • Text before Slider value – allows you to type text or a special symbol before the value in the slider (only for Style – Slider and New Slider)
  • Text after Slider value – allows you to type text or a special symbol after the value in the slider (only for Style – Slider and New Slider)
  • Enable Slider Inputs – enables fields with Select where you can select attribute/tag/custom taxonomies/category values; for numerical attributes there will be input fields instead of the Select field(only for Style – Slider)
  • Show products count per attribute value? – when the setting is enabled, the number of products with each filter value will be displayed
  • Attribute Values count – the number of values of Price Range, which will be displayed in the widget; other values of Price Range can be seen by clicking on “Show value(s)”. Setting Hide the Show/Hide value(s) button in filters must be disabled
  • Display value with color/image box? – when enabled, the attribute/tag/custom taxonomy/category will be displayed next to color/image (only for Style – Color and Image):
    • Top – a value will be displayed at the top of the color/picture
    • Left – a value will be displayed to the left of the color/picture
    • Right – a will be displayed to the right of the color/picture
    • Bottom – a will be displayed at the bottom of the color/picture
    • Tooltip – the value will be displayed as a color/picture tooltip
  • Size of blocks (Height х Width) – allows you to set the block size for Color and Image (only for Style – Color and Image)
  • Date Month Dropdown menu – allows you to enable the display of the drop-down menu in the filter Month(only for Style – Datepicker)
  • Date Year Dropdown menu – allows you to enable the display of the drop-down menu in the filter Year(only for Style – Datepicker)
  • Advanced
    • Description – allows you to add a tooltip with description for the widget
    • CSS class – allows you to set a CSS class for the widget
    • Filter Box Height – allows you to set the size of the filter block
    • Scroll Theme – styles for the filter scrollbar will be available after setting the size of the filter block
    • Checked type – allows you to choose a variant to display the selected value (only for Style – Color and Image):
      • Default
      • Rotate – rotate the selected filter value
      • Scale – zoom in on the selected filter value
      • Blue Shadow – blue shadow around the selected filter value
      • Drop-shadow (EXPERIMENTAL) – a shadow around the selected filter value
      • Color change (EXPERIMENTAL) – the selected filter value will change the filter color
      • Custom CSS – custom CSS for the selected filter value.
    • Values per row – number of attribute values per row in the filter at output
    • Icon Before Title – allows you to upload a picture and select Font Awesome to be displayed before the Filter Name
    • Icon After Title – allows you to upload a picture or select Font Awesome to be displayed after the Filter Name
    • Icon Before Value – allows you to upload a picture or select Font Awesome to be displayed before the filter value
    • Icon After Value – allows you to upload a picture or select Font Awesome to be displayed after the filter value

Filter Settings For Stock status, Sale

Attribute and Values

  • Limit filter values by products from the selected category – filter values will be taken from the category that you select in this setting

Additional

  • Enable collapse option – if the setting is enabled, widget can be minimized:
    • Disable – widget can’t be minimized
    • Enabled with arrow- arrow for minimizing widgets will be displayed in a widget
    • Enabled without arrow – arrow for minimizing widgets will not be displayed in widgets, but the widget can still be minimized
    • Enabled with arrow on mobile – arrow for minimizing widgets will not be displayed in widgets on mobile, but the widget can still be minimized
    • Minimize the widget on load? – if the option is enabled, the widget will be minimized on page load
  • Single Selection. Only one value can be selected at a time – if the option is enabled, only one value can be selected in the filter. Disable the option if you wish to select more values
  • First Element Text – allows you to type text which will be displayed in the Select style filter(only for Style – Select)
  • Show products count per attribute value? – when the setting is enabled, the number of products with each filter value will be displayed
  • Attribute Values count – the number of values of Price Range, which will be displayed in the widget; other values of Price Range can be seen by clicking on “Show value(s)”. Setting Hide the Show/Hide value(s) button in filters must be disabled
  • Advanced
    • Description – allows you to add a tooltip with description for the widget
    • CSS class – allows you to set a CSS class for the widget
    • Filter Box Height – allows you to set the size of the filter block
    • Scroll Theme – styles for the filter scrollbar will be available after setting the size of the filter block
    • Values per row – number of attribute values per row in the filter at output
    • Icon Before Title – allows you to upload a picture and select Font Awesome to be displayed before the Filter Name
    • Icon After Title – allows you to upload a picture or select Font Awesome to be displayed after the Filter Name
    • Icon Before Value – allows you to upload a picture or select Font Awesome to be displayed before the filter value
    • Icon After Value – allows you to upload a picture or select Font Awesome to be displayed after the filter value

Filter Settings for Date

Attribute and Values

  • Limit filter values by products from the selected category – filter values will be taken from the category that you select in this setting

Additional

  • Enable collapse option – if the setting is enabled, widget can be minimized:
    • Disable – widget can’t be minimized
    • Enabled with arrow- arrow for minimizing widgets will be displayed in a widget
    • Enabled without arrow – arrow for minimizing widgets will not be displayed in widgets, but the widget can still be minimized
    • Enabled with arrow on mobile – arrow for minimizing widgets will not be displayed in widgets on mobile, but the widget can still be minimized
    • Minimize the widget on load? – if the option is enabled, the widget will be minimized on page load
  • Date Month Dropdown menu – allows you to enable the display of the drop-down menu in the filter Month
  • Date Year Dropdown menu – allows you to enable the display of the drop-down menu in the filter Year
  • Date visual style – allows you to select the date output variants in the filter (dd – day, mm – month, yyyy – year)
  • Advanced
    • Description – allows you to add a tooltip with description for the widget
    • CSS class – allows you to set a CSS class for the widget
    • Icon Before Title – allows you to upload a picture and select Font Awesome to be displayed before the Filter Name
    • Icon After Title – allows you to upload a picture or select Font Awesome to be displayed after the Filter Name
    • Icon Before Value – allows you to upload a picture or select Font Awesome to be displayed before the filter value
    • Icon After Value – allows you to upload a picture or select Font Awesome to be displayed after the filter value

Filter Settings for Rating

Attribute and Values

  • Limit filter values by products from the selected category – filter values will be taken from the category that you select in this setting

Additional

  • Enable collapse option – if the setting is enabled, widget can be minimized:
    • Disable – widget can’t be minimized
    • Enabled with arrow- arrow for minimizing widgets will be displayed in a widget
    • Enabled without arrow – arrow for minimizing widgets will not be displayed in widgets, but the widget can still be minimized
    • Enabled with arrow on mobile – arrow for minimizing widgets will not be displayed in widgets on mobile, but the widget can still be minimized
    • Minimize the widget on load? – if the option is enabled, the widget will be minimized on page load
  • Single Selection. Only one value can be selected at a time – if the option is enabled, only one value can be selected in the filter. Disable the option if you wish to select more values
  • First Element Text – allows you to type text which will be displayed in the Select style filter(only for Style – Select)
  • Show products count per attribute value? – when the setting is enabled, the number of products with each filter value will be displayed
  • Attribute Values count – the number of values of Rating, which will be displayed in the widget; other values of Rating can be seen by clicking on “Show value(s)”. Setting Hide the Show/Hide value(s) button in filters must be disabled
  • Advanced
    • Description – allows you to add a tooltip with description for the widget
    • CSS class – allows you to set a CSS class for the widget
    • Filter Box Height – allows you to set the size of the filter block
    • Scroll Theme – styles for the filter scrollbar will be available after setting the size of the filter block
    • Values per row – number of attribute values per row in the filter at output
    • Icon Before Title – allows you to upload a picture and select Font Awesome to be displayed before the Filter Name
    • Icon After Title – allows you to upload a picture or select Font Awesome to be displayed after the Filter Name
    • Icon Before Value – allows you to upload a picture or select Font Awesome to be displayed before the filter value
    • Icon After Value – allows you to upload a picture or select Font Awesome to be displayed after the filter value

Apply Filters button

The Apply Filters button widget adds a filtering button, until the button is pressed, filtering will not be performed

Reset Button

Widget Filter Reset Button – Adds a button to reset the selected filters

Hide button – setting to hide the reset button

  • Do not hide – the reset button will always be displayed
  • Hide only when there are no filters on the page – the reset button will be hidden when there are no filters on the page
  • Hide when there are no filters on the page or the page is not filtered

Selected Filters Area

Widget Area Selected Filters

  • Show if nothing is selected – show the widget without the selected filters
  • Hide arrow to collapse widget?
  • Hide this widget on load?

Filter Group Settings

Group Settings

  • Custom CSS class – you can set a custom class for a group
  • Show filters above products
  • Filters in line
    • Maximum number of filters per line
  • Show title only – when the setting is enabled, the filters will be minimized
    • Display on mouse over and hide on mouse leave
  • Filters in this Group – add filters to a group for display on store pages

Search Box

To create a Search Box you need:

  • in the group add the necessary filters for the Search Box
  • enable the Use Group as a Search Box option in the Search Box section
  • select the settings you need in the Search Box section
    • Search page url – select which page will toggle after using the Search Box
      • Shop page – redirect to the default shop page
      • Category page – redirect to the category page
        • Category – you can choose which category will redirect the page to
      • URL – user’s url
        • Custom url – you can specify any link

Widget Settings

To add filters to widgets you need to go to Appearance-> Widgets and select in Available widgets which type of widget you want group or single

In AAPF Filter Group – you can select the group to be displayed

  • Manage groups – open groups page
  • Title – the title that will be displayed on the page
  • Custom CSS Class
  • Group – select a group to display
  • Edit – open to the edit page of the selected group
  • Create group – quick group creation
  • Delete – remove a group widget
  • Save – save changes to the widget

In AAPF One Filter – you can select the filter that you want to display

  • Manage filters – toggle to the filter page
  • Custom CSS Class
  • Filter – select the desired filter
  • Edit – edit the selected filter
  • Create Filter – Quickly create a filter
  • Delete – remove the widget
  • Save – button for saving changes in the widget

Filter Shortcodes

To get the filter shortcode, you need to follow BeRocket-> Product Filters -> Filters and copy the shortcode in the Shortcode column

To get the group shortcode, you need to follow BeRocket -> Product Filters -> Groups and copy the shortcode in the Shortcode column

You can also get a shortcode on the creation page. When creating a Filter or a Group, after saving on the right side of the screen, a Shortcode block will appear in which the shortcode of this filter or group will be displayed

Additional Shortcodes

When berocket_aapf is added to the shortcode, it will instruct to filter or not to filter the shortcode

  • berocket_aapf = true – filter
  • berocket_aapf = false – do not filter

When adding the braapf_sidebar_button shortcode, you can display a custom sidebar toggle button

  • title – text of the custom sidebar output button
  • theme – the theme of the button matches the values selected on the design page
    • “default”
    • “first”
    • “second”
    • “third”
    • “fourth”
    • “fifth”
    • “sixth”

For Developers

Add more styles

Styles can be added to a theme or other plugin.

How to create a new style

Download an example of styles for different types by clicking on this link: DOWNLOAD EXAMPLES.

These examples are fully functional and can be used without changes. It is better, though, to replace some classes and titles, so that there would be no conflicts with other styles in further use.

As a basis you can use the standard styles of the plugin, which are in the template_styles directory. In the developer version of the plugin (which can be downloaded here), you can access JavaScript files for each style separately.

Have a look at the most frequently used style – checkbox.php as an example. The code from it:

if( ! class_exists('BAPF_Custom_checkbox_style') ) {
    class BAPF_Custom_checkbox_style extends BeRocket_AAPF_Template_Style {
        function __construct() {
            $this->data = array(
                'slug'          => 'dev_custom_checkbox',
                'template'      => 'checkbox',
                'name'          => 'Dev Custom Checkbox',
                'name_price'    => 'Dev Custom Price Ranges',
                'file'          => __FILE__,
                'style_file'    => plugin_dir_url( __FILE__ ) . 'checkbox_your_style.css',
                'script_file'   => plugin_dir_url( __FILE__ ) . 'checkbox_your_script.js',
                'image'         => plugin_dir_url( __FILE__ ) . 'checkbox_preview_image.png',
                'image_price'   => plugin_dir_url( __FILE__ ) . 'checkbox_preview_image-price.png',
                'version'       => '1.0',
                'sort_pos'      => '10000',
            );
            parent::__construct();
        }
        function template_single_item( $template, $term, $i, $berocket_query_var_title ) {
            $template = parent::template_single_item($template, $term, $i, $berocket_query_var_title);
            $this->array_set( $template, array('attributes', 'class') );
            $template['attributes']['class'][] = 'some_custom_class_item';

            return $template;
        }
        function template_full($template, $terms, $berocket_query_var_title) {
            $template = parent::template_full($template, $terms, $berocket_query_var_title);
            $this->array_set( $template, array('template', 'attributes', 'class') );
            $template['template']['attributes']['class'][] = 'some_custom_class';
            return $template;
        }
    }
    new BAPF_Custom_checkbox_style();
}
  1. Replace the name of the class BAPF_Custom_checkbox_style with another unique name, replace it in three different strings.
  2. Change the slug to a more unique one. dev_custom_checkbox is being used in the example.
  3. Change the style name and name for the price range name_price (not all types of filters have it).
  4. Replace style_file, which is a CSS file that will be included if you use this style; the location of the file depends on the location of the checkbox.php style file. If there’s no to include any file, then set this option as an empty string.
  5. Replace script_file, which is the JavaScript file that will be included if you use this style; the location of the file depends on the location of the checkbox.php style file. If there’s no need to include any file, then set this option as an empty string.
  6. Replace the image and image_price images, add the links to the images. The resolution of the images must be 375 pixels wide and 220 pixels high. They are displayed on the filter editing page, image_price for the price range and image for all other attributes and taxonomies.

The main parameters and the name for the new style are ready. Now you need to configure what exactly this style will add to the standard template.

In the examples, the style adds some_custom_class class to the main filter element and some_custom_class_item to the element of each attribute value.

Functions and what they change

template_full – applied to edit the filter

Parameters:

  • $template – array with all parameters for generating HTML code
  • $terms – array with all values for an attribute; the array is obtained from the get_terms function
  • $berocket_query_var_title – all filter parameters for generating HTML code

template_single_item – applied to edit an element for each attribute value. This function is not applied in styles where there are no elements (slider, date selection, button, list of selected filters)

Parameters:

  • $template – array with all parameters for generating HTML code
  • $term – all data values of the attribute. One element from array obtained from the get_terms function
  • $i – element order, starts with zero
  • $berocket_query_var_title – all filter parameters for generating HTML code

How to add a new style

How to add styles in the theme you are using:

  1. Create a braapf-template-styles directory in the root of the theme.
  2. Copy new styles to the directory. PHP style files should be located directly in the braapf-template-styles directory.

How to add styles from another plugin or any other directory:

You need to bind to the hook bapf_include_all_tempate_styles to the function, which will include the style files, in our case the file checkbox.php.

add_action( 'bapf_include_all_tempate_styles', 'custom_function_include_tempate_styles' );
function custom_function_include_tempate_styles() {
include_once('PATH_TO_FILE/checkbox.php');
}

How to change filter templates

In addition to styles, the plugin uses various templates for filter output.

Styles are used to add certain classes and make small changes to the position of elements. At the same time templates are used to define the general structure of elements.

The templates for filters can be found in the directory templatesfilters:

  • checkbox.php – template for checkboxes, filters by color and filters by image
  • datepicker.php – template for selecting a range of dates
  • new_slider.php – template for new sliders
  • select.php – template for a drop-down list
  • slider.php – template for old sliders

Templates for other elements are in the directory templateselements:

  • button.php – template for filter application and filter reset buttons
  • selected_filters.php – template for output of selected filters

There are three ways to change the template:

  1. Using hooks is a better method for small changes, as it does not change the initial template when changing the template in the plugin.
  2. Override the template in the theme – use only if you are completely redesigning the template, then you will most likely need to modify the JavaScript code, so that the filters will work correctly with new style and template.
  3. Add a new template to the theme – you can use it instead of the second method if you create a new filter type or need to use new JavaScript code. In this case, the functionality of the other templates will remain unchanged. You also need to create new styles that will use this template.

Modifying the template with hooks

Different templates use different sets of filters, but some are the same.

Templates for filters use two hooks:

Template for other elements uses one hook:

Example code for adding a block to filter before attribute/taxonomy values:

add_filter('BeRocket_AAPF_template_full_content', 'some_custom_berocket_aapf_template_full_content', 4000, 3);

function some_custom_berocket_aapf_template_full_content($template_content, $terms, $berocket_query_var_title) {
    if( $berocket_query_var_title['new_template'] == 'checkbox') {
        $template_content['template']['content']['filter']['content'] = berocket_insert_to_array(
            $template_content['template']['content']['filter']['content'],
            'list',
            array(
                'custom_content' => '<div><h1>SOME CUSTOM HTML</h1><p>Display there anything after title</p></div>'
            ),
            true
        );
    }
    return $template_content;
}

Example code to replace H3 tag with H5 tag in the header:

add_filter('BeRocket_AAPF_template_full_content', 'some_custom_berocket_aapf_template_full_content', 4000, 1);
add_filter('BeRocket_AAPF_template_full_element_content', 'some_custom_berocket_aapf_template_full_content', 4000, 1);
function some_custom_berocket_aapf_template_full_content($template_content) {
    $template_content['template']['content']['header']['content']['title']['tag'] = 'h5';
    return $template_content;
}

Changing the template by overriding the theme

To override a template, you need to create a directory woocommerce-ajax_filtersfilters in the root of the theme. The original templates can be found in the directory templatesfilters. It is necessary to copy the necessary template and then edit it.

Create a new template for the plugin

To create a new template, you need to create the woocommerce-ajax_filtersfilters directory in the root of the topic and create a new file there or copy any standard template from the templatesfilters directory and rename it. It is necessary to use a name that does not coincide with the standard templates.In order to use the created template you need to create a new style. More details about creation of styles can be found at this link Добавить дополнительные стили.

Action Hooks

br_aapf_args_converter_before

Called before converting the data in a link to the required format for further use.

berocket_aapf_filters_group_settings

Used to display additional settings in filter groups.

Parameters

  • $filters – array of values of all settings in the group 
  • $post_name – field name used to save settings
  • $post – post with the settings

bapf_include_all_tempate_styles

Links all styles of filters. Used to get information about all styles and display all styles on the filter creation page. You can link styles from other plugins or themes.

Adding new styles to the theme

The plugin automatically links all styles from the themes, put to the braapf-template-styles directory.

Filter Hooks

Array structure to generate HTML filter markup

To generate HTML markup a special array with all the necessary parameters is used, which can be changed if necessary using the filter hooks.

Example of filter base structure

array(1) {
  ["template"]  => array(4) {
    ["type"]        => string(3) "tag"
    ["tag"]         => string(3) "div"
    ["attributes"]  => array(5) {
      ["class"]         => array(2) {
        [0]               => string(12) "bapf_sfilter"
        ["filter_type"]   => string(10) "bapf_ckbox"
      }
      ["data-op"]       => string(2) "OR"
      ["data-taxonomy"] => string(7) "pa_size"
      ["data-name"]     => string(6) "Size"
      ["id"]            => string(6) "bapf_1"
    }
    ["content"]     => array(2) {
      ["header"]      => array(4) {
        ["type"]        => string(3) "tag"
        ["tag"]         => string(3) "div"
        ["attributes"]  => array(1) {
          ["class"]       => array(1) {
            [0]             => string(9) "bapf_head"
          }
        }
        ["content"]     => array(1) {
          ["title"]       => array(4) {
            ["type"]        => string(3) "tag"
            ["tag"]         => string(2) "h3"
            ["attributes"]  => array(0) {
            }
            ["content"]     => array(1) {
              ["title"]       => string(6) "Size"
            }
          }
        }
      }
      ["filter"]      => array(4) {
        ["type"]        => string(3) "tag"
        ["tag"]         => string(3) "div"
        ["attributes"]  => array(1) {
          ["class"]       => array(1) {
            [0]             => string(9) "bapf_body"
          }
        }
        ["content"]     => array(1) {
          ["list"]        => array(4) {
            ["type"]        => string(3) "tag"
            ["tag"]         => string(2) "ul"
            ["attributes"]  => array(0) {}
            ["content"]     => array(3) {
              ["element_0"]   => array(4) {
                ["type"]        => string(3) "tag"
                ["tag"]         => string(2) "li"
                ["attributes"]  => array(0) {}
                ["content"]     => array(2) {
                  ["checkbox"]    => array(3) {
                    ["type"]        => string(8) "tag_open"
                    ["tag"]         => string(5) "input"
                    ["attributes"]  => array(4) {
                      ["data-name"]   => string(1) "L"
                      ["id"]          => string(10) "bapf_1_558"
                      ["type"]        => string(8) "checkbox"
                      ["value"]       => int(558)
                    }
                  }
                  ["label"]       => array(4) {
                    ["type"]        => string(3) "tag"
                    ["tag"]         => string(5) "label"
                    ["attributes"]  => array(1) {
                      ["for"]         => string(10) "bapf_1_558"
                    }
                    ["content"]     => array(1) {
                      ["name"]        => string(1) "L"
                    }
                  }
                }
              }
              ["element_1"]   => array(4) {
                ["type"]        => string(3) "tag"
                ["tag"]         => string(2) "li"
                ["attributes"]  => array(0) {}
                ["content"]     => array(2) {
                  ["checkbox"]    => array(3) {
                    ["type"]        => string(8) "tag_open"
                    ["tag"]         => string(5) "input"
                    ["attributes"]  => array(4) {
                      ["data-name"]   => string(1) "M"
                      ["id"]          => string(10) "bapf_1_559"
                      ["type"]        => string(8) "checkbox"
                      ["value"]       => int(559)
                    }
                  }
                  ["label"]       => array(4) {
                    ["type"]        => string(3) "tag"
                    ["tag"]         => string(5) "label"
                    ["attributes"]  => array(1) {
                      ["for"]         => string(10) "bapf_1_559"
                    }
                    ["content"]     => array(1) {
                      ["name"]        => string(1) "M"
                    }
                  }
                }
              }
              ["element_2"]   => array(4) {
                ["type"]        => string(3) "tag"
                ["tag"]         => string(2) "li"
                ["attributes"]  => array(0) {}
                ["content"]     => array(2) {
                  ["checkbox"]    => array(3) {
                    ["type"]        => string(8) "tag_open"
                    ["tag"]         => string(5) "input"
                    ["attributes"]  => array(4) {
                      ["data-name"]   => string(1) "S"
                      ["id"]          => string(10) "bapf_1_560"
                      ["type"]        => string(8) "checkbox"
                      ["value"]       => int(560)
                    }
                  }
                  ["label"]       => array(4) {
                    ["type"]        => string(3) "tag"
                    ["tag"]         => string(5) "label"
                    ["attributes"]  => array(1) {
                      ["for"]         => string(10) "bapf_1_560"
                    }
                    ["content"]     => array(1) {
                      ["name"]        => string(1) "S"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

BeRocket_AAPF_template_single_item

Filtering of elements of a single Checkbox filter value; select for building HTML code.

Parameters

  • $element – array with elements
  • $term – value of the attribute, for which HTML is generated
  • $i – indicates the order number of the attribute
  • $berocket_query_var_title – all parameters for the current filter

BeRocket_AAPF_template_full_content

Filtering of all elements of one filter for building HTML code.

Parameters

  • $template_content – array with filter elements
  • $terms – all attribute values for this filter
  • $berocket_query_var_title – all parameters for the current filter

BeRocket_AAPF_template_full_element_content

Filtering of Update button, Reset button, Selected filters area for building HTML code.

Parameters

  • $template_content – array with widget elements
  • $berocket_query_var_title – all parameters for this widget

BeRocket_AAPF_getall_Template_Styles

Get a list of all styles that were already connected.

Parameters

  • $custom_taxonomies_list – list of taxonomies with required data

berocket_aapf_get_terms_args

All parameters for the get_terms WordPress function

Parameters:

  • $args – an array with arguments that will be used for the get_terms function;
  • $filter_data – the filter settings, that were set when the filter was created;
  • $widget_args – the widget parameters.

berocket_aapf_get_terms_additional

Additional parameters that are used to change the values received from the get_terms WordPress function.

Parameters:

  • $additional – an array with additional parameters:
    • hierarchical(boolean) – sorts values hierarchically;
    • depth(int) – all child elements, that are deeper than this value in the hierarchy, will be deleted; if the value is set to zero, nothing will be deleted;
    • operator(string) – the operators used in the product count in values can be either OR, or AND;
    • recount_tax_query(array) – the tax_query array, which is going to be used in recalculating the values, is taken from the current query for products by default;
    • disable_recount(boolean) – disables the recalculation of the values based on the other filters and variations (depends on global settings);
    • disable_hide_empty(boolean) – disables deleting values without products for the page. If the attribute value is not used in any product (in store as a whole), the value is deleted anyway
  • $filter_data – the filter settings, that were set when the filter was created
  • $widget_args – the widget parameters
  • $get_terms_args – parameters for the get_terms WordPress function

berocket_aapf_is_filtered_page_check

Checks if filters are applied on the current page.

Parameters

  • $is_filtered – filters applied or not
  • $place – name of the location where the hook is called

berocket_aapf_seo_meta_filters_hooks_list

List of values for “Position of selected filters” option in plugin settings in SEO tab.

Parameters

  • $options – array with values where each element is an array with the following structure: array(“value” => “function_name”, “text” => “Visual name in the drop-down list”)

You can declare the “function_name” function in the function.php file of the topic or anywhere else where it will be publicly available.

Parameters of the “function_name” function

  • $filters – current generated text, usually an empty string
  • $text – initial text for the current section
  • $section – section name (header, title, description)
  • $terms_filtered – array of current filters

berocket_aapf_seo_meta_filtered_term_continue

Skip attribute value when making a list of filters to display in title, header, description page

Parameters

  • $skip – miss the value or not (initially false)
  • $term_parsed – array of data about the value of an attribute (may differ depending on the filter type)

berocket_aapf_seo_meta_filtered_taxonomy_label

Changes the attribute name for title, header, description blocks of the page.

Parameters

  • $taxonomy_label – attribute name
  • $taxonomy – object of attribute taxonomy
  • $term – current value of the taxonomy (can be an array of values)
  • $term_parsed – array of data about the value of an attribute (may differ depending on the filter type)

berocket_aapf_seo_meta_filtered_term_label

Changes the name of the attribute value for the use in title, header, description blocks of the page.

Parameters 

  • $term_name – name of attribute value
  • $term – current value of the taxonomy (can be an array of values)
  • $taxonomy – object of attribute taxonomy
  • $term_parsed – array of data about the value of an attribute (may differ depending on the filter type)

berocket_aapf_seo_meta_filtered_taxonomy_price_label

Change the price name for the use in title, header, description blocks of the page.

Parameters

  • $price_name – price name. Applied __(‘Price’, ‘woocommerce’).

berocket_aapf_seo_meta_filtered_price_label

Change the text of the price value for the use in title, header, description blocks of the page.

Parameters 

  • $price_name – text of price value 
  • $price_data – all price data available on filtering
  • $prices – array with initial price and final price

berocket_aapf_seo_meta_filters_text_before

Text replacement for title, header, page block description. This hook is connected to the function that is selected in the settings.

Parameters

  • $text_return – text to be used; initially an empty string
  • $text – initial text
  • $section – section name (title, header, description)
  • $terms_filtered – array with data of all selected filters

berocket_aapf_seo_meta_filters_text_return

Text replacement for title, header, page block description. This hook is called after the replacement and verification, and presents the finished text.

Parameters

  • $text_return – text to be used
  • $text – initial text
  • $section – section name (title, header, description)
  • $terms_filtered – array with data of all selected filters

berocket_aapf_load_simple_filter_creation_{$type}

Hook of obtaining HTML code to create a new element for widgets. Possible values $type: single, group.

Parameters

  • $html – HTML code of the form for creating a new element

berocket_aapf_save_simple_filter_creation_{$type}

Hook for saving a new element for widgets. Possible values $type: single, group.

Parameters

  • $data – array with data about the new element of an array format (‘value’ => $post_id, ‘name’ => $element_name, ‘name2’ => $element_title, ‘edit’ => $edit_post_link)

berocket_aapf_current_page_url

Current page without GET query and filters.

Parameters

  • $current_page_url – current page URL without GET query and filters
  • $options – array with plugin settings

aapf_localize_widget_script

Array filtering with settings for JavaScript.

Parameters

  • $settings – an array with settings

berocket_aapf_wcshortcode_is_filtering

Checks whether the WooCommerce short code should be filtered or not.

Parameters

  • $is_filter -the WooCommerce short code should be filtered (boolean)
  • $query_vars – shortcode data array for WP_Query
  • $atts – array of shortcode attributes
  • $name – shortcode name

berocket_add_out_of_stock_variable

Filtering of array with the ID of products to be excluded. Used to exclude variable products where no suitable variations are available.

Parameters

  • $products – array with product ID
  • $terms – array with filters that are applied
  • $limits – array with filter-sliders, which are applied

berocket_filters_query_vars_already_filtered

Filtering of array with parameters for WP_Query. The array already contains all filters and limitations.

Parameters

  • $query_vars – array with parameters for WP_Query
  • $terms – array with filters that are applied
  • $limits – array with filter-sliders, which are applied

berocket_aapf_check_is_wc_main_query

Filtering of the check whether the current query  is the main one for WooCommerce.

Parameters

  • $is_wc_main_query – current query is the main one (boolean)
  • $query – WP_Query object, query
  • $is_shortcode – filtering of WooCommerce shortcode (boolean)

berocket_filters_query_already_filtered

Filtering WP_Query. Already contains filters and limitations.

Parameters

  • $query – WP_Query for getting products with filters
  • $terms – array with filters that are applied
  • $limits – array with filter-sliders, which are applied

berocket_aapf_return_query_filtered

Filtering of any WP_Query query that passes through a filtering function, regardless of whether filters are added to it or not.

Parameters

  • $query – WP_Query query
  • $is_shortcode – WooCommerce short code (boolean)

berocket_price_filter_meta_key

Filtering of meta key for product price.

Parameters

  • $price_meta_key – meta key for price;  _price by default
  • $position – hook position name

berocket_aapf_filters_on_page_load

Filtering of parameters to be added to WP_Query to filter products.

Parameters

  • $args – array with parameters for WP_Query

berocket_aapf_group_before_all

Filtering of parameters for a group of filters, before displaying all filters. It is also used to output additional blocks before the filter group.

Parameters

  • $custom_vars – array with additional parameters for the group
  • $group_settings – group of filter settings

berocket_aapf_group_new_args

Filtering of arguments in a group of filters that are applied to all filters.

Parameters

  • $new_args – array with parameters for filter widget
  • $group_settings – group of filters settings
  • $custom_vars – array with additional parameters for the group

berocket_aapf_group_new_args_filter

Filtering of arguments in a group of filters that are applied to each filter.

Parameters

  • $new_args – array with parameters for the filter widget
  • $group_settings – group of filters settings
  • $filter – filter ID
  • $custom_vars – array with additional parameters for the group

berocket_aapf_group_before_filter

Filtering of parameters for a group of filters, before displaying each filter. It is also applied to output additional blocks before each filter in the  group of filters.

Parameters

  • $custom_vars – array with additional parameters for the group
  • $group_settings – group of filter settings

berocket_aapf_group_after_filter

Filtering parameters for a group of filters, after each filter is displayed. It is also used to output additional blocks after each filter in the filter group.

Parameters

  • $custom_vars – array with additional parameters for the group
  • $group_settings – group of filter settings

berocket_aapf_group_after_all

Filtering of parameters for a group of filters, after all filters are displayed. Also applied to display additional blocks after the filter group.

Parameters

  • $custom_vars – array with additional parameters for the group
  • $group_settings – group of filter settings

berocket_filter_filter_type_array

Filtration of array with filter types.

Parameters

  • $filter_type_array – array of filter types with parameters

br_get_cache

Hook to get data from the cache; initially returns false. When caching is enabled in the plugin, the function to return data from the cache is bound to this hook.

Parameters

  • $data – cache data
  • $key – key for caching
  • $group – group for caching

br_set_cache

Hook to store data in a cache, initially returns true. When caching is enabled  in the plugin, the function to save data to the cache is bound to this hook.

Parameters

  • $set_result – data saved (boolean)
  • $key – key for caching
  • $value – value to save
  • $group – group for caching
  • $expire – cache saving time

berocket_aapf_get_attributes

Filtering of array with all WooCommerce product attributes.

Parameters 

  • $attributes – array with all product attributes

berocket_aapf_listener_taxonomies

Filtration of array of all taxonomies by which the products are filtered.

Parameters

  • $taxonomies – array of taxonomies

berocket_aapf_listener_taxonomies_operator

Filtering of operators array for all taxonomies by which products are filtered.

Parameters

  • $taxonomies_operator – array of operators for taxonomies

berocket_aapf_tax_query_attribute

Filtering of attribute when added to tax_query for WP_Query by products

Parameters

  • $taxonomy – an array with parameters for one tax_query element

berocket_min_max_filter

Filtering of price slider values when identifying filters in a link.

Parameters 

  • $prices – array with prices: from – to price

berocket_widget_widget_type_array

Filtering of array with widget types for filter settings.

Parameters

  • $widget_types – array with widget types

aapf_widget_instance

Filtering of settings of widget with filters

Parameters

  • $instance – array with filter settings

aapf_widget_args

Filtering parameters for widget with filters.

Parameters 

  • $args – array with parameters of widget

aapf_widget_text_before_price

Filtering of text before price, can be set up in the price filter.

Parameters

  • $text – text before the price

aapf_widget_text_after_price

Filtering of text after price, can be set up in the price filter.

Parameters 

  • $text – text after the price

berocket_aapf_widget_display_custom_filter

Apply to prevent filters from being output. Applied to output specific filters.

Parameters 

  • $not_display – do not output filters; false by default
  • $widget_type – filter widget type
  • $instance – filter settings
  • $args – widget parameters
  • $object – object BeRocket_AAPF_Widget class for calling required functions

berocket_aapf_widget_terms

Filtering of wp_term values to be used in filter when outputting.

Parameters

  • $terms – array with attribute values

berocket_aapf_widget_css_class

Filtering of custom classes, which will be added to the widget.

Parameters

  • $classes – string with classes to be added, may be empty

berocket_aapf_widget_style

Filtering of CSS styles, which will be added to the widget.

Parameters

  • $styles – string with styles to be added, may be empty

berocket_price_filter_widget_min_amount

Filtering of the minimum price value from a selected range of values.

Parameters

  • $price – minimum price
  • $base_price – initial minimum price before all filters

berocket_price_filter_widget_max_amount

Filtering of the maximum price value from a selected range of values.

Parameters

  • $price – maximum price
  • $base_price – initial maximum price before all filters

berocket_query_var_title_before_widget

Filtering of all values that are passed to the filter output template.

Parameters

  • $parameters – array of all parameters for transmitting
  • $type – filter type
  • $instance – all filter settings

berocket_price_slider_widget_min_amount

Filtering of the minimum price value from the selected value interval and from the minimum available value.

Parameters

  • $price – minimum price

berocket_price_slider_widget_max_amount

Filtering of the maximum price value from a selected range of values and from the maximum available value.

Parameters

  • $price – maximum price

berocket_aapf_get_price_range

Filtering of the data that the get_price_range function returns.

Parameters

  • $price_range – array of two values of the minimum price and the maximum price; false, if the price is not indicated

brAAPFcompat_WCvariation_out_of_stock_where

Filtering of part of the request with WHERE to remove products that are not available when checking variable products.

Parameters

  • $query – string with request

berocket_aapf_wcvariation_filtering_total_query

Filtering of request to get variations that are not available for the current filters.

Parameters

  • $query – request as an array
  • $input – initial data
  • $terms – selected filters
  • $limits – selected sliders
  • $current_attributes – attributes in filters
  • $current_terms – attribute values in filters

berocket_query_var_title_before_element

Filtering of data, used in Update button, Reset button, Selected filters area.

Parameters

  • $set_query_var_title – all parameters
  • $additional – additional parameters for the element

berocket_recount_taxonomy_data

Filtering of data used to recount the number of products for attribute values.

Parameters

  • $taxonomy_data – all data
  • $terms – list of all values of the attribute

berocket_aapf_recount_remove_all_berocket_tax_query

An array of filtering using tax_query taxonomies, which is applied in the request for recounting the number of products for attribute values.

Parameters 

  • $tax_query – array of filtering by taxonomies
  • $terms – values of the current attribute
  • $taxonomy_data – parameters for recounting the number of products for attribute values
  • $old_tax_query – current array $tax_query

berocket_aapf_recount_remove_all_berocket_meta_query

An array of filtering using meta_query product meta data, which is applied in the request for recounting product quantity for attribute values.

Parameters 

  • $meta_query – array of filtering with metadata
  • $terms – values of the current attribute
  • $taxonomy_data – parameters for recounting the number of products for attribute values
  • $old_meta_query – current array $meta_query

berocket_aapf_get_terms_class_args

Filtering of arguments that are passed to the get_terms function in WordPress; obtaining attribute values for filters.

Parameters 

  • $args – arguments for get_terms
  • $additional – additional parameters that are used for further value filtering

berocket_aapf_get_terms_class_additional

Filtering of additional parameters to get the correct values of attributes; obtaining attribute values for filters.

Parameters 

  • $additional – additional parameters that are used for further value filtering
  • $args – arguments for get_terms

berocket_aapf_get_terms_filter_after

Filtering of the obtained attribute values.

Parameters

  • $terms – attribute values from the get_terms function
  • $args – arguments for get_terms
  • $additional – additional parameters that are used for further value filtering

braapf_template_builder_type_{$type}

Generation of HTML code of an element by a filter builder.

The plugin defines 2 types of element{$type} tag and tag_open.

Parameters 

  • $html – HTML code, empty string; must be generated with this hook
  • $element – all element parameters

braapf_new_widget_edit_page_widget_types

Filtering of the list of widget types on the page of creating filters.

Parameters

  • $widget_types – array with data of all types of widgets

Filtering of price range.

Parameters 

  • $price_range – array of two minimum price and maximum price values

Filtering of array with request elements to count the number of products in a price range.

Parameters 

  • $query_args – array from which the request is collected

Changes the name of additional attributes for use in title, header, description blocks of the page.

Parameters

  • $taxonomy_label – attribute name
  • $term_parsed – array of data about the value of an attribute (may differ depending on the filter type)
  • $custom_name – array with all available additional attributes

Changes the value name of additional attributes for use in title, header, description blocks of the page.

Parameters 

  • $term_name – value name of attribute 
  • $term_parsed – array of data about the value of an attribute (may differ depending on the filter type)

Functions

br_is_filtered

A boolean that specifies whether there are filters on the page or not.

Parameters

  • $filters [boolean] – check regular filters
  • $limits [boolean] – check sliders with attributes
  • $price [boolean] – check price slider
  • $search [boolean] – check your search

Returns

[boolean] A boolean that specifies whether there are filters or not.

br_is_term_selected

A boolean that specifies whether attribute value is selected or not for a checkbox, radio button or drop-down list.

Parameters 

  • $term [object] – WP_Term object with the value of the attribute to be checked
  • $checked [boolean] – for checkbox, radio button
  • $child_parent [boolean] – search in children
  • $depth [int] – search directory tree 

Returns

[string] A string with text for a checkbox, radio button or drop-down list.

br_get_selected_term

Returns values selected in filters for taxonomy.

Parameters 

  • $taxonomy [string] – taxonomy slug 

Returns

[array] An array with the ID of taxonomy values.

berocket_filter_query_vars_hook

Adding filtering to an array to be used for WP_Query

Parameters 

  • $query_vars [array] – array with current parameters

Returns

[array] An array with parameters collected from an incoming array and data for filtering.

Options

WooCommerce AJAX Products Filter use different options in different places.

br_filters_options

Contains all options from plugin settings page.

Array with default values

$defaults = array(
        'plugin_key'                      => '',
        'no_products_message'             => 'There are no products meeting your criteria',
        'pos_relative'                    => '1',
        'no_products_class'               => '',
        'products_holder_id'              => 'ul.products',
        'woocommerce_result_count_class'  => '.woocommerce-result-count',
        'woocommerce_ordering_class'      => 'form.woocommerce-ordering',
        'woocommerce_pagination_class'    => '.woocommerce-pagination',
        'woocommerce_removes'             => array(
            'result_count'                => '',
            'ordering'                    => '',
            'pagination'                  => '',
        ),
        'control_sorting'                 => '',
        'seo_friendly_urls'               => '',
        'slug_urls'                       => '',
        'nice_urls'                       => '',
        'filters_turn_off'                => '',
        'show_all_values'                 => '',
        'hide_value'                      => array(
            'o'                           => '',
            'sel'                         => '',
        ),
        'first_page_jump'                 => '',
        'scroll_shop_top'                 => '',
        'scroll_shop_top_px'              => '-180',
        'recount_products'                => '',
        'selected_area_show'              => '',
        'object_cache'                    => 'wordpress',
        'ajax_request_load'               => '1',
        'ajax_request_load_style'         => 'jquery',
        'product_per_row'                 => '4',
        
        'styles_input'                    => array(
            'checkbox'               => array( 'bcolor' => '', 'bwidth' => '', 'bradius' => '', 'fcolor' => '', 'backcolor' => '', 'icon' => '', 'fontsize' => '' ),
            'radio'                  => array( 'bcolor' => '', 'bwidth' => '', 'bradius' => '', 'fcolor' => '', 'backcolor' => '', 'icon' => '', 'fontsize' => '' ),
            'slider'                 => array( 'line_color' => '', 'line_height' => '', 'line_border_color' => '', 'line_border_width' => '', 'button_size' => '', 
                                               'button_color' => '', 'button_border_color' => '', 'button_border_width' => '', 'button_border_radius' => '' ),
            'product_count'          => 'round',
            'product_count_position' => '',
        ),
        'ajax_load_icon'                  => '',
        'ajax_load_text'                  => array(
            'top'                         => '',
            'bottom'                      => '',
            'left'                        => '',
            'right'                       => '',
        ),
        'description'                     => array(
            'show'                        => 'click',
            'hide'                        => 'click',
        ),
        'user_func'                       => array(
            'before_update'               => '',
            'on_update'                   => '',
            'after_update'                => '',
        ),
        'user_custom_css'                 => '',
        'br_opened_tab'                   => 'general',
        'number_style'                    => array(
            'thousand_separate' => '',
            'decimal_separate'  => '.',
            'decimal_number'    => '2',
        ),
        'debug_mode'                      => '',
    );

br_filters_version

Contains current plugin version. Uses for correct plugin update.

berocket_permalink_option

Contains all settings from permalink page.

Array with default values

$default_permalink = array (
        'variable' => 'filters',
        'value'    => '/values',
        'split'    => '/',
    );

BeRocket_account_option

Contains BeRocket Account key.

Array with default values

$default_account = array (
        'account_key' => '',
    );

Javascript

Functions and hooks applied by the plugin in Javascript.

How to use JavaScript hooks

Since version 3.0 (1.5 for the free version) the plugin uses functions similar to the hooks in WordPress for JavaScript code.

Find more information about all JavaScript hooks on this page. Find more information on the functions for applying filters on this page.

When adding a hook straight away on page load, you need to check whether the functions are available. If they are not available use the berocket_hooks_ready event, which is called immediately after initializing functions.

Example code for replacing the function of unfolding filters:

bapf_custom_smb_open_function = function(use_default, $this) {
    $this.find('.bapf_body').first().show();
    if( $this.find('.bapf_colaps_smb').length ) {
        $this.find('.bapf_colaps_smb').removeClass('fa-chevron-down').addClass('fa-chevron-up');
    }
    return false;
}
if ( typeof(berocket_add_filter) == 'function' ) {
    berocket_add_filter('colaps_smb_open_apply', bapf_custom_smb_open_function);
} else {
    jQuery(document).on('berocket_hooks_ready', function() {
        berocket_add_filter('colaps_smb_open_apply', bapf_custom_smb_open_function);
    });
}

Javascript Functions

Functions can be called in custom scripts.

berocket_add_filter

Adds new functions for filtering on calling berocket_apply_filters, works similarly as WordPress function add_filter.

Parameters

  • tag – filter name
  • callback – name of the function that will work for the filter; the function should be global
  • priority – priority of execution of functions for the same filter
berocket_apply_filters

Applies filters, works similarly as WordPress function apply_filters.

Parameters

  • tag – filter name
  • filter_element – value to be passed to the function in its first argument, in other words – the value to be filtered
  • args… – additional values to be passed by filter to the function
berocket_do_action

Performs action, works similarly as WordPress function do_action.

Parameters

  • tag – name of the performed action
  • args… – additional values to be passed to the function
berocket_remove_filter

Removes already added function from filter, works similarly as WordPress function remove_filter.

Parameters

  • tag – filter name
  • callback – function, that will be removed, should be passed the same function, that was previously passed to berocket_add_filter
  • priority – priority of function execution
berocket_throw_error

Applied for some errors, works in the same way as berocket_apply_filters, but is applied to resolve errors. berocket_throw_error is the name of the hook.

Parameters

  • error_name – error name
  • args… – function can be passed an infinite number of arguments
braapf_init_load

Initializes all necessary scripts on the page. Can be called after replacing filters with other plugins.

braapf_update_products

Function to update products and filters from a new page with selected filters.

Параметры

  • context – context in which the product loading is called, filter by default
  • element – indicates the element that calls product loading
braapf_grab_all

Get all selected filters.

Parameters

  • parent – element on the page; if the element is specified, only filters inside this element will be returned
braapf_grab_single

Get selected values from one filter.

Parameters

  • element – main filter element with bapf_sfilter class
  • selected_filters – already selected filters, there must be an empty array
  • grab_single – get values only from this element; the default is false if this option is not defined (other filters with the same taxonomy will be searched as well)
braapf_compact_filters

Prepare filters for use in link.

Parameters

  • filters_start – list of selected filters; the braapf_grab_all function returns an array of data in the required format
braapf_compat_filters_to_string

Generates a string out of prepared filters for use in link.

Parameters

  • compat_filters – prepared filters; the braapf_compact_filters function returns an array of data in the required format
  • filter_mask – mask by which a string is generated for each filter, %t%[%v%] by default
  • glue_between_taxonomy – string that combines filters with each other
braapf_get_current_url_data

Get link details.

Parameters

  • url – parse link, the current page link is applied by default, if called without parameters
braapf_build_url_from_urldata

Applied to generate a new link to the data page, that can be obtained from the braapf_get_current_url_data function.

Parameters

  • url_data – data for generating a page
  • parameters – additional parameters, that can be applied by other functions
braapf_filter_products_by_url

Uploading products and filters by a link.

Parameters

  • url – link which is applied to obtain all data from

Javascript hooks

Starting with version 3.0, JavaScript code of the plugin has an analogue of WordPress hook to change the behavior of filters.

All functions are analogs of WordPress functions.

Functions that are applied for hooks and WordPress analogs:

berocket_add_filter – add_filter

berocket_apply_filters – apply_filters

berocket_do_action – do_action

berocket_remove_filter – remove_filter

input_ckbox_changed

Called before receiving data from the checkbox, the new value is not selected yet.

Parameters

  • element – currently modified element
  • taxonomy – taxonomy for the current element
  • value – slug element value or ID
  • checked – additionally selected or cancelled

Related functions

  • braapf_convert_ckbox_to_radio – makes it possible to select only one value

filter_changed_element

Called when a filter is changed.

Parameters

  • filter_changed_element – element data for getting this element from the page, can be applied even after filtering
  • $this – currently modified item

Related functions

  • braapf_count_before_changed_element – records the last modified element
ajax_load_from_pagination

Functions that are called when replacing products for pagination.

Parameters

  • functions – object with arrays of functions to call in certain situations
  • href – current link to get new products
braapf_filters_mask

Mask that is applied to output the link.

Parameters

  • url_mask – mask to generate the link, change only if the data on the server side will be converted to the required format
before_update_products_context

Context of the function call for product updates.

Parameters

  • context – context of the product update function call. The function may work differently depending on the context, filter by default 
  • element – element from which the product update function is called

Related functions

  • braapf_child_parent_fix_selected – function disables children elements when changing parent values

apply_filters_to_page

Apply filters to the current page and replace products.

Parameters

  • filter – call a new page load with filtered products and replace them and filters (boolean)
  • context – context in which product filtering is called
  • url – link to which the query will be sent

Related functions

  • braapf_search_box_alternative_send – sends a query for Search box
apply_filters_to_page_partial

If filters are not fully applied, you can only partially apply them to replace filters.

Parameters

  • filter – partial filter update is applied (boolean)
  • context – context in which product updates are called
  • element – element which calls the product update
  • url – link to be loaded

Related functions

  • braapf_child_parent_load_with_update_button – enables partial loading when there are child/parent filters
  • braapf_search_box_alternative_send_partial (900) – enables partial loading for search box
  • braapf_count_before_update_button – enables partial loading for loading the number of products before an update

ajax_load_from_filters_partial

Functions that are called when partially changing a page, filters only.

Parameters

  • functions – object with arrays of functions to call in certain situations
  • url – current link to get new products

Related functions

braapf_count_before_update_add_function – function to get the number of products before updating

page_has_products_holder

False if there is no product block on the page.

Parameters

  • noproducts – no product block on the page
  • url – page from which the products will be loaded
ajax_load_from_filters

Functions that are called when a page is completely replaced.

Parameters

  • functions – object with arrays of functions to call in certain situations
  • url – current link to get new products
  • context – in which context filters are called, default by default  
grab_all_filters

Filtering data of all filters that were gathered on a page or in a specific block.

Parameters

  • selected_filters – all selected filters
  • $parent – in this block the filters are selected inside it, if false, then from the whole page
grab_single_filter_taxonomy_undefined

Called if the taxonomy of the filter is not defined, so that a certain situation can be processed.

Parameters

  • single_data – data of one filter, object type {name:tax_name, taxonomy:taxonomy, values:values, glue:glue, operator:operator}, where values is an array with objects {value:value, html:name}
  • element – current element for which data is selected
  • selected_filters – all already selected filters  
grab_single_filter_exist

Added filter (boolean), if true, the script of adding is not called for the second time.

Parameters

  • exist – filter added (boolean)
  • element – element for which everything is checked
  • selected_filters – all filters already selected
grab_single_filter

Called on receiving each filter.

Parameters

  • single_data – object with data of the current element
  • element – current element for which data is selected
  • selected_filters – all already selected filters 
grab_single_filter_default

Called after defining a filter that should be added, even if one has already been added.

Parameters

  • single_data – object with data of the current element
  • element – current element for which data is selected
  • selected_filters – all already selected filters 

Related functions

  • braapf_child_parent_grab_single – replaces all parent values with the children ones
  • braapf_grab_single_ion – gets correct values for ionRangeSlider
  • braapf_grab_single_select – gets correct values for drop-down lists
  • braapf_grab_single_jqrui – gets correct values for jQuery Slider
  • braapf_grab_single_datepicker – gets the correct values for choosing a date
glue_by_operator

A symbol that combines the values of one filter, usually operator dependent.

Parameters

  • glue – symbol by which filter values are combined
  • operator – current filter operator

Related functions

  • braapf_glue_by_operator_separate_link – replaces the character by a comma, applied when enabling the link add-on as in WooCommerce.
compat_filters_result_single

Filters an object with the name of the taxonomy and a list of all values in a line for one filter.

Parameters

  • filter – object with data {taxonomy:taxonomy, values:values_string}
  • value – object with initial data for value generation

Related functions

  • braapf_compat_filters_result_separate_link – replaces the common value with a separate variable in GET query.
compat_filters_result

Filters an array of objects with the name of the taxonomy and a list of all values in a string for all filters.

Parameters

  • filters – list of all filters that are ready for use in links
  • filters_start – initial array with parameters to all filters
compat_filters_to_string_single

Filters the ready string for a link with taxonomy and values for each filter.

Parameters

  • single_string – ready string that will be added
  • val – initial parameters for the filter
  • compat_filters – initial parameters for all filters
  • filter_mask – mask on which the string is built
  • glue_between_taxonomy – symbol, that combines the strings of individual filters

Related functions

  • braapf_compat_filters_to_string_single_separate_link – changes the string when the add-on for links as in WooCommerce is enabled.
compat_filters_to_string

Filters ready string for all filters.

Parameters

  • filters_string – formed string with filters
  • compat_filters – initial parameters for all filters
  • filter_mask – mask on which the string is built
  • glue_between_taxonomy – symbol, that combines the strings of individual filters
get_current_url_data

Filters object, which is obtained from the current page link.

Parameters

page_data – data of the current page as an object {baselink:link, queryargs:query_arr, filter:”, page:paged}

Related functions

  • braapf_get_current_filters – adds current filters
  • braapf_get_current_filters_nice_url – adds current filters when Nice URLs option is enabled
  • braapf_get_current_filters_separate_link – adds current filters when the add-on for links as in WooCommerce is enabled

Filtering of the basic link for the page to be loaded (with GET query and filters).

Parameters

  • baselink – basic page link
  • url_data – current link data 
  • parameters – additional parameters
url_from_urldata_linkget

Filtering of the final link for the page (with GET query, filters are added by the same hook).

Parameters

  • url_get – link with GET query
  • url_data – current link data
  • parameters – additional parameters for generating a link
  • url – basic link without GET query and filters
  • query_get – GET query

Related functions

  • braapf_set_filters_to_link – adds filters to the link
  • braapf_set_filters_to_link_nice_url – adds filters to the link if Nice URLs option is enabled
  • braapf_set_filters_to_link_separate_link – adds filters to the link with an add-on for links as in WooCommerce
build_url_parameters_default

Filtering of the default parameters that can be applied on generating a link.

Parameters

  • parameters – all default settings, empty object by default
load_products_ajax_on_popstate

Uses AJAX product loading when HTML5 Popstate is activated.

Parameters

  • enabled – enabled (boolean), true by default 
ajax_load_from_url_url

Filtering of ready link before querying a product page.

Parameters 

  • url – link for query
  • send_data – additional data to be sent, usually an empty object
  • callback_func – functions that are called at different stages
  • type – type (context) of loading a new page, usually default
ajax_load_from_url_data

Filtering of sent data before querying the product page.

Parameters

  • send_data – additional data to be sent, usually an empty object
  • url – link for query
  • callback_func – functions that are called at different stages
  • type – type (context) of loading a new page, usually default
ajax_load_from_url_callback

Filtering of list of functions to be called when querying a product page.

Parameters

  • callback_func – functions that are called at different stages
  • url – link for query
  • send_data – additional data to be sent, usually an empty object
  • type – type (context) of loading a new page, usually default

ajax_load_from_url_beforeSend

Filtering of xhr object before sending the query.

Parameters

  • xhr – object before sending a query
  • url – link for query
  • send_data – additional data to be sent, usually an empty object
  • callback_func – functions that are called at different stages
  • type – type (context) of loading a new page, usually default

Related functions

  • braapf_pagination_prevent_filters_load – adds an additional parameter when using pagination
  • braapf_additional_header – adds an additional parameter for all queries
  • braapf_scroll_shop_to_top – scrolls page to products
  • braapf_add_loader_element – adds a loading element that closes the page
ajax_load_from_url_done

Filtering of data on successful query that came in before calling all functions.

Parameters

  • data – data that came in from a new page
  • url – link for query
  • send_data – additional data to be sent, usually an empty object
  • callback_func – functions that are called at different stages
  • type – type (context) of loading a new page, usually default

Related functions

  • braapf_hierarhical_save (1) – saves all parameters of hierarchical filters
  • braapf_collapse_status_save (1) – saves open/closed filters
  • braapf_show_hide_values_save (1) – saves which values are hidden and which are shown
ajax_load_from_url_done_after

Filtering of data on successful query that came in after all functions were called.

Parameters

  • data – data that came in from a new page
  • url – link for query
  • send_data – additional data to be sent, usually an empty object
  • callback_func – functions that are called at different stages
  • type – type (context) of loading a new page, usually default

Related functions

  • braapf_hierarhical_set (1000) – restores all parameters of hierarchical filters
  • braapf_collapse_status_set (1000) – restores open/closed filters
  • braapf_show_hide_values_set (1000) – restores which values are hidden and which are shown
ajax_load_from_url_fail

Filtering of jqXHR object on querying error before calling all functions.

Parameters

  • jqXHR – error data
  • url – link for query
  • send_data – additional data to be sent, usually an empty object
  • callback_func – functions that are called at different stages
  • type – type (context) of loading a new page, usually default
ajax_load_from_url_fail_after

Filtering of jqXHR object on querying error after all functions are called.

Parameters 

  • jqXHR – error data
  • url – link for query
  • send_data – additional data to be sent, usually an empty object
  • callback_func – functions that are called at different stages
  • type – type (context) of loading a new page, usually default
ajax_load_from_url_always

Filtering of data on any query status, that came in before calling all functions.

Parameters 

  • data – page or errors
  • url – link for query
  • send_data – additional data to be sent, usually an empty object
  • callback_func – functions that are called at different stages
  • type – type (context) of loading a new page, usually default
ajax_load_from_url_always_after

Filtering of data on any query status that came in after calling all functions.

Parameters 

  • data – page or error data
  • url – link to query
  • send_data – additional data to be sent, usually an empty object
  • callback_func – functions that are called at different stages
  • type – type (context) of loading a new page, usually default

Related functions

  • braapf_remove_loader_element – removes the element that closes page on load
  • bapf_universal_theme_compatibility (2500) – runs scripts for compatibility with plugins and themes
jqrui_data_slidr_ion

Filtering of object for initializing ionRangeSlider.

Parameters 

  • ionRangeData – parameters for initializing slider
  • $this – element for which the initialization of the slider is performed
jqrui_slidr_ion_{data-display}

Filtering of output value in the slider to change the appearance of ionRangeSlider.

Parameters 

  • value – one of the values of the slider
  • $slider – element with slider

Related functions

  • braapf_jqrui_slidr_ion_value_wc_price (jqrui_slidr_ion_wc_price) – styling for the price.
  • braapf_jqrui_slidr_ion_value_arr_attr (jqrui_slidr_ion_arr_attr) – styling for attributes

Filtering of the value when output in link as values of ionRangeSlider filter.

Parameters 

  • value_ready – value ready for a link
  • values – slider values, an array with two values
  • input_values – values styled for the slider
  • $slider – slider element
  • single_data – data of the current filter

Related functions

  • braapf_jqrui_slidr_ion_values_link_arr_attr (jqrui_slidr_ion_link_arr_attr) – replaces the output for attributes
jqrui_slidr_{data-display}

Filtering of value on the output in slider to change the look of jQuery Slider.

Parameters 

  • input_values – array with slider values
  • $element – element with slider

Related functions

  • braapf_jqrui_slidr_values_wc_price (jqrui_slidr_wc_price) – price styling for a slider
  • braapf_jqrui_slidr_values_arr_attr (jqrui_slidr_arr_attr) – attribute styling for a slider

Filtering of the value on the output in a link as values of jQuery Slider filter. 

Parameters 

  • value_ready – value ready for a link
  • values – slider values, an array with two values
  • input_values – values styled for the slider
  • $slider – slider element
  • single_data – data of the current filter

Related functions

  • jqrui_slidr_link_arr_attr – styling for attributes
hidden_clickable_close_mouseleave

Close filters only with title when the mouse is removed from the element.

Parameters

  • close – close (boolean), true by default 
  • $this – current element for which the hook is called
hidden_clickable_open_delay

Delay before opening filters with title only.

Parameters

  • delay – delay in milliseconds, 0 by default 
  • $this – element for which the hook is called
  • opened_colaps – number of previously opened elements 
bapf_rst_nofltr_hide

Hide the filter reset button if there are no filters.

Parameters

  • hide – hide button, depending whether there’s filter (boolean)
bapf_rst_sel_show

Shows filter reset button if filters are selected.

Parameters

  • show – show button (boolean); the default value depends on whether at least one filter is selected

Selector for links inside pagination.

Parameters

  • selector – selector for links inside pagination
  • pagination_selector – selector for pagination
pagination_href_from_clicked_a

Link when clicking on pagination.

Parameters

  • url – link that will be loaded by the plugin
  • element – element that is clicked on
filter_mobile_width

Width for mobile devices.

Parameters

  • width – width value, 767 by default 
filter_tablet_width

Width for tablets.

Parameters

  • width – width value, 1024 by default 
remove_same_filters_to_prevent_errors

Removes all filter duplicates on the page.

Parameters

  • remove – deletes all filter duplicates  
  • element – filter, for which duplicates are removed
  • id – filter identifier
update_page_on_error

Refreshes the page if there is an error on filtering.

Parameters

  • reload – refreshes the page, true by default 
default_selected_filters_area_single

HTML code for one element of the selected filters.

Parameters

  • html – ready HTML code
  • data – object with data about the selected filter
default_selected_filters_area_full_exist

HTML code of all selected filters, if any.

Parameters

  • html – code that will be output as selected filters
  • html_last – code that is created by an array with selected filters
  • selected_filters – array with data of the selected filters
default_selected_filters_area_full_notexist

HTML code of all selected filters, if there are no filters.

Parameters

  • html – code that will be output as selected filters
  • html_last – code that is created from an array with selected filters, usually an empty string
  • selected_filters – array with data of the selected filters
remove_shortcode_fix_filters

Removes filters that are applied to fix the number of goods.

Parameters

  • remove – removes filters, true by default
scroll_shop_to_top

Scrolls to the top of product page after filtering.

Parameters

  • scroll – scrolls page, value depends on the settings
universal_theme_compatibility

Use scripts for compatibility with themes and other plugins.

Parameters

  • use – use scripts, true by default
uncode_theme_compatibility

Use the script for compatibility with the Uncode theme.

Parameters

  • use – use script, by default it depends on whether the Uncode theme script is on the page (boolean)
flatsome_theme_compatibility

Use script for compatibility with the Flatsome theme.

Parameters

  • use – use script, by default depends on whether the Flatsome theme script is on the page (boolean)
woodmart_theme_compatibility

Use script for compatibility with the WoodMart theme.

Parameters

  • use – use the script, by default it depends on whether the WoodMart theme script is on the page (boolean)
divi_theme_compatibility

Use the script for compatibility with the Divi theme.

Parameters

  • use – use the script, by default it depends on whether the Divi theme script is on the page (boolean)
rey_theme_compatibility

Use the script for compatibility with the Rey theme.

Parameters

  • use – use the script, by default it depends on whether the Rey theme script is on the page (boolean)
layzyloadimage_script_compatibility

Use the script for compatibility with the lazy loading images script.

Parameters

  • use – use the script, by default depends on whether the script is on the page (boolean)
jetpacklazyimages_script_compatibility

Use script for compatibility with the lazy loading images script of the JetPack plugin.

Parameters 

  • use – use the script, by default depends on whether the script is on the page (boolean)
braapf_init_filtered_set

Called when installation of filters that the goods are already filtered by.

Parameters 

  • braapf_filtered_filters – list of selected filters

Related functions

  • braapf_reset_buttons_hide – shows or hides the filter reset button
  • braapf_selected_filters_area_set_init – updates widget with the selected filters
update_products

Called to load new products, filters, etc.

Parameters

  • context – context of product update call
  • element – an element that calls product update

Related functions

  • braapf_update_products – product update


braapf_init

Called when initializing filters.

Parameters

  • braapf_selected_filters – list of selected filters

Related functions

  • braapf_reset_buttons_hide – shows or hides the filter reset button
  • braapf_grab_all_init – gets all selected filters
  • braapf_selected_filters_area_set_init – updates the widget with the selected filters
  • braapf_init_ion_slidr – initializes ionRnageSlider
  • bapf_select2_init – initializes select2
  • braapf_init_jqrui_slidr – initializes jQuery UI Slider
  • braapf_init_datepicker – initializes jQuery UI Datepicker
braapf_init_for_parent

Applied to initialize elements that belong to a certain block.

Parameters

  • element – element inside which the filters are initialized

Related functions

  • braapf_init_ion_slidr_for_parent – initialization of ionRangeSlider
  • bapf_select2_init_for_parent – initialization of Select2 
  • braapf_init_jqrui_slidr_for_parent – initialization of jQuery UI Slider

Files

  • woocommerce-filters.php – main plugin file
  • css – folder with CSS files
    • admin.css – styles for admin panel
    • colpick.css – styles for color picker block
    • font-awesome.min.css – standard Font Awesome styles
    • jquery-ui.min.css – styles for jQuery UI
    • widget.css – styles for pages with widgets
    • images – folder with images for jQuery UI
    • scrollbar – styles for custom scrollbar
    • styler – form styler
  • fonts – Font Awesome fonts
  • images – images that uses in plugin
  • includes – folder with additional PHP files
    • functions.php – public functions
    • updater.php – BeRocket Updater for plugins update from BeRocket site
    • widget.php – AJAX Product Filters widget
  • js – folder with JavaScript files
    • admin.js – JavaScript for admin panel settings and widget settings
    • colpick.js – JavaScript for color picker in admin panel settings
    • j.doe.cloud.min.js – generate tag cloud in tag widget
    • jquery-ui.min.js – jQuery UI uses only in admin panel
    • mobiles.min.js – additional JavaScript for jQuery UI for mobile devices
    • widget.min.js – JavaScript for AJAX Product Filters widgets
    • scrollbar – JavaScript for custom sliderbar
    • styler – JavaScript for form styler
  • templates – templates for widgets and settings
    • admin-settings.php – plugin settings
    • admin.php – templates for AJAX Product Filters widget settings
    • checkbox.php – templates for widget with checkbox type
    • color.php – templates for widget with color type
    • color_ajax.php – templates for color/image picker in widget with color or image type
    • image.php – templates for widget with image type
    • permalink_option.php – templates for options in permalink settings
    • radio.php – templates for widget with radio type
    • select.php – templates for widget with select type
    • slider.php – templates for widget with slider type
    • tag_cloud.php – templates for tag widget with tag cloud type
    • widget_start.php – templates before all widget types
    • widget_end.php – templates after all widget types
    • widget_selected_area.php – templates for Selected Filters area
    • widget_update_button.php – templates for Update Products button