Snippets

Use these snippets to customize the appearance and functionality of WooCommerce Product Bundles.

To use a snippet, download the linked file and activate it as you would with any other plugin. Alternatively, copy the contained code into your child theme’s functions.php file.

Note: We are unable to provide support for customizations under our Support Policy. If you need to customize a snippet, or extend its functionality, seek assistance from a qualified WordPress/WooCommerce Developer. We highly recommend Codeable, or a Certified WooExpert.

Snippets ↑ Back to top

Make optional bundled items checked/selected by default ↑ Back to top

By default, optional bundled item checkboxes are unticked by default. This can be changed with the following snippet:

 

Remove the “optional” suffix from optional bundled item titles ↑ Back to top

By default, the extension adds an “- optional” suffix next to the title of bundled items that have been marked as optional. To remove this suffix, use the following snippet/plugin:

 

Override the default bundled item quantity value ↑ Back to top

By default, the quantity field of every bundled product is initialized with a value equal to the Minimum Quantity. This behavior can be changed by using the following snippet/plugin, which assumes a bundle ID equal to 1000 and a bundled item ID equal to 500 (change these values as required).

 

Define quantity constraints (min/max) for the total amount of selected bundled items ↑ Back to top

Out of the box, Product Bundles does not include options for defining bundled item quantity constraints at bundle-level. Instead it is highly recommended to use WooCommerce Mix ‘n Match, which allows you to define container-level quantity constraints for assortments of grouped products.

Similar functionality can be added to Product Bundles by using the Product Bundles – Min/Max Items mini-extension (not officially supported).

Allow discounts over bundled product sale prices ↑ Back to top

By default, sale prices are ignored when applying bundled item discounts. This behavior can be altered by using the following snippet/plugin:

 

Prevent product bundles price strings from showing up in range-format ↑ Back to top

Ensure that you are using the latest version of Product Bundles, then use the following snippet/plugin:

 

Change the number of bundled product columns displayed when the Grid Layout option is active ↑ Back to top

The following snippet demonstrates how to adjust the number of bundled item columns to 4:

 

Change the appearance of item subtotals in the cart/orders ↑ Back to top

When the Grouped selection is active under Item Grouping, the subtotals of parent/child line items in cart/order templates are added together and the actual subtotal of the parent item is replaced by the aggregated subtotal. Additionally, the subtotals of individually-priced items are indented and displayed with a Subtotal: prefix.

To prevent this, use the following snippet/plugin:

 

Questions & Support ↑ Back to top

Have a question before you buy? Please fill out this pre-sales form.
Already purchased and need assistance? Get in touch with us via the Help Desk!

WooCommerce - the most customizable eCommerce platform for building your online business.

Back to the top