WooCommerce / Product Table
The buy column adds a product without leaving the table. AJAX add to cart is on by default. Quantity fields, checkboxes, and the cart summary are off until you turn them on.
Include buy in columns. Out-of-stock and non-purchasable products do not get a button. A variation row that is out of stock shows “Out of stock” instead.
| Attribute | Default | What it does |
|---|---|---|
cart_button | button | button is Add to cart. checkbox replaces the button with a checkbox for multi-add. button_checkbox also renders the checkbox, not a button plus a checkbox. |
quantities | false | Show a quantity field in the buy column. This is not a column name. |
ajax_cart | true | Add without a full page reload. false uses the normal WooCommerce add-to-cart link. |
button_text | Show details | Label for the separate button column, not the Add to cart label. |
The quantity field starts at the product’s minimum purchase quantity, and it respects the maximum when WooCommerce has one.
multi_add="true" prints Select all and Add selected to cart above the table. That only works when the buy column is a checkbox. The buy column also has to be visible.
[yh_wc_product_table columns="sku,name,stock,price,buy" cart_button="checkbox" quantities="true" multi_add="true" rows_per_page="100"]
Each checked row is added with its quantity. Name Your Price rows must have an amount filled in before they will add. See Variable products and Name Your Price.
| Attribute | Default | What it does |
|---|---|---|
footer_cart | false | A bar under the table with the item count, subtotal, View cart, and Checkout. |
floating_cart | false | A floating cart button with the same links. |
direct_checkout | false | After a successful add, send the customer to checkout instead of staying on the table. |
quick_view | false | Add an eye icon in the buy column. It opens a modal with the image, price, and short description. |
[yh_wc_product_table columns="image,name,price,buy" quick_view="true" footer_cart="true" ajax_cart="true"]
The parent row needs a variation selected. With variations="dropdown" (the default), the customer picks each attribute in the buy cell first.
Fix: Leave the default, or use variations="rows" so each variation has its own Add to cart. variations="false" replaces Add to cart with a link to the product page.
Select all only ticks checkboxes. cart_button="button" never prints checkboxes, and a missing buy column removes them too.
Fix: Use cart_button="checkbox" and include buy in columns.
WooCommerce rejected the add. Sold individually, a minimum quantity, or a Name Your Price amount outside the min and max will do that. The notice is the reason.
Fix: Read the notice above the table. Match the quantity to the product’s min and max. For Name Your Price, enter an allowed amount before adding.