Features
- User friendly and self-explanatory administration panel.
- Displays all the needed data for your variable products with options to disable them.
- The table is searchable on-the-fly
- Supports “any” when you set your product variations
- Supports “custom attributes” that you may add to the products on the fly
- “Add Selected to Cart” with select all checkbox for bulk adding variations to cart
- Option to disable or enable the table/grid per product.
- In Stock, Out of Stock and Low Stock (with threshold) custom messages
- Easy to use shortcode with full documentation to help you put the table where ever you need and shortcodes are executed.
- Easy to use global shortcode that will display all variations of all variable products on any page.
- Extensible / developer friendly. You can alter the plugin without hacking it, but via WordPress filters and actions.
- Make variations stand out with your custom sticker/icon. You can enable/disable or override it per variation.
- Supports WooCommerce Variation Swatches and Photos
- Supports YITH WooCommerce Wishlist
- Supports YITH WooCommerce Quick View
- Supports WooCommerce Product Gift Wrap
- Supports Additional Variation Images Gallery for WooCommerce
- AJAX can be enabled from settings
- Sorting of table columns in the frontend
- Default table header (auto generated), generic custom table header and per product custom table header can be set
- Easily translatable via .po / .mo files.
- Available translations: English, Greek, Français, Italiano, Polish.
Reviews
Enabled WooCommerce Variation Swatches and Photos support
Usage
In order to use the Woocommerce Variations to Table – Grid plugin, please navigate from your WordPress administration panel to “Woocommerce -> Variations Table“Options
- Exclude Categories: You may select whole categories to exclude the plugin in order to display the variations with the default select menus
- Display Thumbnail: Select “yes” to display the thumbnail column or “no” to hide it.
- Thumbnail Width in Pixels: You may define the with of the thumbnail in pixels in this field
- Display Stock: Select “yes” to display the stock condition column or “no” to hide it.
- In Stock Text: If the stock is displayed, you may set the text to display when the variation is in stock
- Out of Stock Text: If the stock is displayed, you may set the text to display when the variation is out of stock
- Low Stock Text: If the stock is displayed, you may set the text to display when the variation stock is low
- Low Stock Threshold: Enter the quantity of the variation that will trigger the low stock status
- Display Price: Select “yes” to display the price column or “no” to hide it.
- Display Total (New): Select “yes” to display the totals column or “no” to hide it.
- Display Quantity Field: Select “yes” to display the quantity input field of the products to be added to cart column or “no” to hide it.
- Display Add To Cart: Select “yes” to display the add to cart button column or “no” to hide it.
- Display Wishlist: Select “yes” to display the wishlist icon column or “no” to hide it.
- Display Image: Select “yes” to display an extra image/sticker/icon column or “no” to hide it.
- Add Image: Upload the extra image/sticker/icon by clicking on the Open Media Manager button.
- Display Description: Select “yes” to display a description under the row of the variation.
- Display Table Header: Select “yes” to display table header.
- Custom Table Header: You may write your own custom HTML code for all table headers here.
- Enable Ajax: Select “yes” to enable AJAX for “add to cart” and “wishlist”
- Enable Responsive Table: Select “yes” to make the table mobile friendly
- Order Columns: You may order the columns by drag-n-dropping the list elements
- You are ready to go! * Save Changes *
Shortcode
On your product page or anywhere were shortcodes are executed (eg. posts and pages), you may use the shortcode [vartable] . If you just put the shortcode then it will read the options of the plugin that you have set via the admin settings panel.In order to customize the shortcode you may use the following attributes (respectively to the above options):
- id
- sku
- thumb
- thumb_size
- stock
- in_stock_text
- out_stock_text
- low_stock_text
- low_stock_thresh
- price
- offer
- image
- qty
- cart
- wishlist
- gift
- ajax
- desc
- head
- responsive
- sorting
[vartable thumb=1 thumb_size=150 stock=1 in_stock_text="We have plenty" out_stock_text="Everything is gone" offer=0 qty=1 ajax=0]
As you may notice we have not set the cart, wishlist etc. attributes, hence the shortcode will do as we have set via the plugin’s settings panel
If you use the shortcode outsite the product page, then the “id” attribute of the shortcode is mandatory!!!
All Variable Products All variations Shortcode
You may display all variable products variations with the shortcode [vartableall]. The same arguments as above can be used AND title = 1 for displaying the title of the product before each table AND categoriescategories can be set with category id and comma separated, eg [vartableall categories=10,14] to include products from these two categories only.
Do not use the id option on this shortcode.
Developer Friendly
Many hooks are in place. Please search the code for a full list. Below are some of them with examples.You can add alter the css class of the link to the full image for each variation with the filter “vartable_thumb_class_filter”, eg.
add_filter( 'vartable_thumb_class_filter', 'my_vartable_custom__img_class');
function my_vartable_custom__img_class($class) {
$class = $class.' myclass anotherclass';
return ($class);
}
The Woocommerce “single_add_to_cart_text” filter is in place. Please refer to Woocommerce documentation.
Actions
You may add your own css class for the table wit “vartable_table_class”, eg.add_action( 'vartable_table_class', 'my_vartable_table_class');
function my_vartable_table_class($class) {
$class = ' table-hover table-striped ';
return ($class);
}
You can add text before and after the table with, “vartable_before_table” and “vartable_before_table”, eg.
add_action( 'vartable_before_table', 'my_vartable_before_table');
function my_vartable_before_table($text) {
$text = 'This text ';
$text .= 'will go before the table';
echo $text;
}
add_action( 'vartable_after_table', 'my_vartable_after_table');
function my_vartable_after_table($text) {
$text = 'This text ';
$text .= 'will go after the table';
echo $text;
}
Remove the table from the top and add it after the product description
function vartable_move_after_description($content) {
if (get_post_type() == 'product' && is_single()) {
$content = $content . do_shortcode('[vartable]');
}
// otherwise returns the database content
return $content;
}
add_filter( 'the_content', 'vartable_move_after_description' );
remove_action( 'woocommerce_variable_add_to_cart', 'vt_woocommerce_variable_add_to_cart', 30 );
Please do not use add_action if you are using the shortcode method
Requirements
- WordPress 4.0+
- Woocommerce 3.6+
- PHP 7.0+
Frequently Asked Questions
I get Fatal error: Cannot redeclare woocommerce_variable_add_to_cart()
Please try de-activating WooCommerce, activating the plugin and re-activating WooCommerceCan I list all variations of all variable products?
Yes, you can via the [vartableall] shortcode.Can I use custom attributes when adding a variation?
Yes, this was added on version 1.0.6.Can I put this anywhere in my site?
Yes, you can via the shortcode, if the field where you put it shortcodes are executed. You will have to specify the id of the variable product on the shortcode arguments.Can I disable the grid for just one or any product I want?
Yes, you can via the product edit screen. Please select “Yes” at the option “Disable variations table” under the product’s general settings tab.Can I disable the grid for any category I want?
Yes, you may do this via the admin panel that is provided under “Woocommerce ? Variations Table”.If I disable the table/grid for a product can I still use the shortcode?
Yes, the shortcode is not getting disabled.Wishlist variations miss the selected attributes
Due to the way that wishlist works, it will not support variable products that you have set attributes as “any”.What about stock check and AJAX?
By enabling AJAX, this will disable the stock quantity check when adding to cart via the plugin.
Installation
This wordpress plugin can be installed as any other wordpress plugin. Installation is simple.- Extract the zip file you have downloaded.
- Login to your administration panel (ex. http://www.yourdomain.com/wp-admin).
- Go to Plugins -> Add New.
- At the top of the page click the “Upload Plugin” link
- Click choose file (or what your browser uses to navigate to your files)
- From the extracted files of step one (1) navigate to and select woo-variations-table.zip and click “Install Now“
- You may be asked to confirm your wish to install the Plugin.
- If this is the first time you’ve installed a WordPress Plugin, you may need to enter the FTP login credential information. If you’ve installed a Plugin before, it will still have the login information. This information is available through your web server host.
- Click Proceed to continue with the installation. The resulting installation screen will list the installation as successful or note any problems during the install.
- If successful, please click Activate Plugin to activate it.
- If you get an error, please de-activate WooCommerce, activate the plugin and re-activate WooCommerce