Title: Dash Commerce's Replies | WordPress.org

---

# Dash Commerce

  [  ](https://wordpress.org/support/users/dashcommerce/)

 *   [Profile](https://wordpress.org/support/users/dashcommerce/)
 *   [Topics Started](https://wordpress.org/support/users/dashcommerce/topics/)
 *   [Replies Created](https://wordpress.org/support/users/dashcommerce/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/dashcommerce/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/dashcommerce/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/dashcommerce/engagements/)
 *   [Favorites](https://wordpress.org/support/users/dashcommerce/favorites/)

 Search replies:

## Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Variation Swatches for WooCommerce] Fixed: Add Product Bundle Support](https://wordpress.org/support/topic/fixed-add-product-bundle-support/)
 *  [Dash Commerce](https://wordpress.org/support/users/dashcommerce/)
 * (@dashcommerce)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/fixed-add-product-bundle-support/#post-13333574)
 * Hey Phillip, I have solved the issue.
 * I’ve put this code in the Product Bundle plugin:
 *     ```
       //Put in the Woocommerce Product Bundle plugin.
   
       function hide_out_of_stock_option( $option ){
       	return 'yes';
       }
   
       add_action( 'woocommerce_before_template_part', function( $template_name ) {
   
   
   
       	if( $template_name !== "single-product/add-to-cart/bundle.php" ) {
       		//var_dump($template_name);
       		return;
       	}
       	add_filter( 'pre_option_woocommerce_hide_out_of_stock_items', 'hide_out_of_stock_option' );
   
       } );
   
       add_action( 'woocommerce_after_template_part', function( $template_name ) {
   
       	if( $template_name !== "single-product/add-to-cart/bundle.php"  ) {
       		return;
       	}
   
       	remove_filter( 'pre_option_woocommerce_hide_out_of_stock_items', 'hide_out_of_stock_option' );
   
       } );
       ```
   
    -  This reply was modified 5 years, 8 months ago by [Dash Commerce](https://wordpress.org/support/users/dashcommerce/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Variation Swatches for WooCommerce] Fixed: Add Product Bundle Support](https://wordpress.org/support/topic/fixed-add-product-bundle-support/)
 *  [Dash Commerce](https://wordpress.org/support/users/dashcommerce/)
 * (@dashcommerce)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/fixed-add-product-bundle-support/#post-13333440)
 * Hi Philipp,
 * No luck so far.
 * I have added your code at line 11: [https://ibb.co/v44X3KM](https://ibb.co/v44X3KM)
 * and I am getting this error: [https://ibb.co/dBNnWhh](https://ibb.co/dBNnWhh)
 * I have tried to put this snippet in other parts of the code and the error disappears,
   but the swatches plugin is still not working with product bundles.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Variation Swatches for WooCommerce] Fixed: Add Product Bundle Support](https://wordpress.org/support/topic/fixed-add-product-bundle-support/)
 *  [Dash Commerce](https://wordpress.org/support/users/dashcommerce/)
 * (@dashcommerce)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/fixed-add-product-bundle-support/#post-13327796)
 * Hi Philipp!
 * How did you initialize the $form constant?
 * I should put this code on line 11 of the file woo-variation-swatches/assets/js/
   frontend.js, right?
 * We are using the woo-variation-swatches plugin version 1.0.80.
 * Many Thanks!
    -  This reply was modified 5 years, 8 months ago by [Dash Commerce](https://wordpress.org/support/users/dashcommerce/).

Viewing 3 replies - 1 through 3 (of 3 total)