Show/hide/move the search box, reset link, pagination & other elements above & below the product table
WooCommerce Product Table comes with various elements that can be displayed above or below the table. These make it easier for customers to search, sort and filter the table. These elements are:
- Search box - the keyword search box at the top right of the table.
- Reset button - the 'Reset' link next to the search box which removes the current search/filters.
- Page length - the “Show <x> per page” dropdown below the table.
- Product totals - the total number of products displayed below the table (e.g. “50 products”).
- Pagination - the paging options that appear below the table when a product table goes onto multiple pages.
- Footer - an optional row at the bottom of the table where you can repeat the column headings
- Scroll offset - if you have a sticky header, you can also change where the table reloads so that the top isn't hidden behind the sticky header
- Add selected to cart - if you're using the 'checkbox' add to cart option, you can choose whether the 'Add Selected to Cart' button appears above or below the table, or both. Please see our article on add to cart options.
Search box
The search_box
option controls whether to display the search box, and where to display it. Defaults to top
. Choose from one of the following:
top
– show above the table (top-right)bottom
– show below the table (bottom-right)both
- show above and below the tablefalse
– hide the search box
You can control this option globally on the plugin settings page, or directly in the shortcode for individual product tables.
Example: [product_table search_box="false"]
Reset button
The reset_button
option controls whether to display the ‘Reset’ button above the table. Defaults to true
. Set to false
to hide the reset button.
You can control this option globally on the plugin settings page, or directly in the shortcode for individual product tables.
Example: [product_table reset_button="false"]
Page length
The page_length
option controls whether to display the “Show <x> products” drop-down menu, and where to display it. Defaults to bottom
. Choose from one of the following:
top
– show above the table (top-left)bottom
– show below the table (bottom-left)both
- show above and below the tablefalse
– hide the page length drop-down
You can control this option globally on the plugin settings page, or directly in the shortcode for individual product tables.
Example: [product_table page_length="bottom"]
Product totals
The totals
option controls whether to display the product totals message (e.g. “50 products”). Defaults to bottom
. Choose from one of the following:
top
– show above the table (top-right)bottom
– show below the table (bottom-right)both
- show above and below the tablefalse
– hide the product totals
You can control this option globally on the plugin settings page, or directly in the shortcode for individual product tables.
Example: [product_table totals="top"]
Pagination buttons
The pagination
option controls whether to display the pagination buttons and where to display them. Defaults to bottom
. Choose from one of the following:
top
– show above the table (top-right)bottom
– show below the table (bottom-right)both
- show above and below the tablefalse
– hide the pagination buttons
You can control this option globally on the plugin settings page, or directly in the shortcode for individual product tables.
Example: [product_table pagination="false"]
Pagination type
The paging_type
option controls the style of pagination used for your product table. Defaults to numbers
. Choose one of the following:
numbers
– page numbers onlysimple
– ‘Previous’ and ‘Next’ onlysimple_numbers
– ‘Previous’ and ‘Next’ buttons, plus page numbersfull
– ‘First’, ‘Previous’, ‘Next’ and ‘Last’ buttonsfull_numbers
– ‘First’, ‘Previous’, ‘Next’ and ‘Last’ buttons, plus page numbers
You can control this option globally on the plugin settings page, or directly in the shortcode for individual product tables.
Example: [product_table paging_type="full_numbers"]
Footer
The show_footer
option lets you show the column headings at the bottom of the table as well as the top. The default is false
(i.e. hide the footer headings), but you can set this to true
to show them.
This option does not appear on the plugin settings page, and is controlled directly in the shortcode.
Example: [product_table show_footer="true"]
Scroll offset
When paging between multiple pages of results in your table, Woocommerce Product Table will automatically “jump” back to the top each time. This is particularly useful if you are displaying a large number of products on each page. The plugin attempts to scroll to the correct position on the page but sometimes it doesn’t quite calculate this correctly. This is because each website and WordPress theme is different and some can have features which interfere with the scroll position – e.g. sticky navigation menus.
The scroll_offset
option lets you override the scroll amount or disable this behavior altogether. The default scroll amount is 15
. If you find that the top of your table is “chopped off” when moving between pages, try increasing this to a larger number (e.g. scroll_offset="50"
). If you’d like to disable automatic scrolling, set this option to false
.
This option does not appear on the plugin settings page, and is controlled directly in the shortcode.
Example: [product_table scroll_offset="35"]