Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimjasson/c4ccf02148b03fc64185489e9edafff7 to your computer and use it in GitHub Desktop.
Save jimjasson/c4ccf02148b03fc64185489e9edafff7 to your computer and use it in GitHub Desktop.
Use this snippet to change the bundled items column count when using the 'Grid' Layout option
<?php
/**
* Plugin Name: WooCommerce Product Bundles - Bundled Items Grid Layout column count
* Plugin URI: http://woocommerce.com/products/product-bundles/
* Description: Use this snippet to change the bundled items column count when using the 'Grid' Layout option.
* Version: 1.0
* Author: SomewhereWarm
* Author URI: http://somewherewarm.gr/
* Developer: Jason Kytros
*
*
* Copyright: © 2018 Jason Kytros (jask@somewherewarm.gr).
* License: GNU General Public License v3.0
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
add_filter( 'woocommerce_bundled_items_grid_layout_columns', 'wc_pb_grid_layout_change_number_of_columns', 10, 2 );
function wc_pb_grid_layout_change_number_of_columns( $columns, $bundle ) {
return 4;
}
@MaxDrljic
Copy link

Excellent stuff, thanks.

@aandslk
Copy link

aandslk commented Feb 14, 2021

This works for desktop. But not looks good on mobile. It would be great if it is possible to extend to different screen sizes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment