<commit_before><?php
// WooCommerce functions
if ( ! function_exists( 'wbst_woocommerce_setup' ) ) :
  function wbst_woocommerce_setup() {
    add_theme_support( 'woocommerce' );
  }
endif;
add_action( 'after_setup_theme', 'wbst_woocommerce_setup' );
/*
Set Default Thumbnail Sizes for WooCommerce Product Pages, on Theme Activation
*/
global $pagenow;
if ( is_admin() && isset( $_GET['activated'] ) && $pagenow == 'themes.php' ) add_action( 'init', 'dazzling_woocommerce_image_dimensions', 1 );
/*
Define image sizes
*/
function dazzling_woocommerce_image_dimensions() {
  $catalog = array(
		'width' 	=> '350',	// px
		'height'	=> '453',	// px
		'crop'		=> 1 		// true
	);
	$single = array(
		'width' 	=> '570',	// px
		'height'	=> '708',	// px
		'crop'		=> 1 		// true
	);
	$thumbnail = array(
		'width' 	=> '350',	// px
		'height'	=> '453',	// px
		'crop'		=> 0 		// false
	);
	// Image sizes
	update_option( 'shop_catalog_image_size', $catalog ); 		// Product category thumbs
	update_option( 'shop_single_image_size', $single ); 		// Single product image
	update_option( 'shop_thumbnail_image_size', $thumbnail ); 	// Image gallery thumbs
}
/*
 * Add basic WooCommerce template support
 *
 */
// Remove original WooCommerce wrappers
remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10);
remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10);
// Add BST Plus wrappers
add_action('woocommerce_before_main_content', 'wbst_wrapper_start', 10);
add_action('woocommerce_after_main_content', 'wbst_wrapper_end', 10);
function wbst_wrapper_start() {
  echo '<div id="content" class="site-content container">';
  echo '<div id="primary" class="content-area col-sm-12 col-md-8 '.of_get_option('site_layout').' ">';
  echo '<main id="main" class="site-main" role="main">';
}
function wbst_wrapper_end() {
  echo '</main></div>';
}
// Replace WooComemrce button class with Bootstrap
/*add_filter('woocommerce_loop_add_to_cart_link', 'dazzling_commerce_switch_buttons');
function wbst_commerce_switch_buttons( $button ){
  $button = str_replace('button', 'btn btn-default', $button);
  return $button;
}*/
/*
Place a cart icon with number of items and total cost in the menu bar.
*/
function wbst_woomenucart($menu, $args) {
	// Check if WooCommerce is active and add a new item to a menu assigned to "Navbar Upper Right" (Primary Navigation Menu) location
	if ( !in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) || 'navbar_upper_right' !== $args->theme_location )
		return $menu;
	ob_start();<commit_msg>Correction<commit_after><?php
// WooCommerce functions
if ( ! function_exists( 'wbst_woocommerce_setup' ) ) :
  function wbst_woocommerce_setup() {
    add_theme_support( 'woocommerce' );
  }
endif;
add_action( 'after_setup_theme', 'wbst_woocommerce_setup' );
/*
Set Default Thumbnail Sizes for WooCommerce Product Pages, on Theme Activation
*/
global $pagenow;
if ( is_admin() && isset( $_GET['activated'] ) && $pagenow == 'themes.php' ) add_action( 'init', 'dazzling_woocommerce_image_dimensions', 1 );
/*
Define image sizes
*/
function dazzling_woocommerce_image_dimensions() {
  $catalog = array(
		'width' 	=> '350',	// px
		'height'	=> '453',	// px
		'crop'		=> 1 		// true
	);
	$single = array(
		'width' 	=> '570',	// px
		'height'	=> '708',	// px
		'crop'		=> 1 		// true
	);
	$thumbnail = array(
		'width' 	=> '350',	// px
		'height'	=> '453',	// px
		'crop'		=> 0 		// false
	);
	// Image sizes
	update_option( 'shop_catalog_image_size', $catalog ); 		// Product category thumbs
	update_option( 'shop_single_image_size', $single ); 		// Single product image
	update_option( 'shop_thumbnail_image_size', $thumbnail ); 	// Image gallery thumbs
}
/*
 * Add basic WooCommerce template support
 *
 */
// Remove original WooCommerce wrappers
remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10);
remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10);
// Add BST Plus wrappers
add_action('woocommerce_before_main_content', 'wbst_wrapper_start', 10);
add_action('woocommerce_after_main_content', 'wbst_wrapper_end', 10);
function wbst_wrapper_start() {
  echo '<div id="content" class="site-content container">';
  echo '<div id="primary" class="content-area col-sm-12 col-md-8 '.of_get_option('site_layout').' ">';
  echo '<main id="main" class="site-main" role="main">';
}
function wbst_wrapper_end() {
  echo '</main></div>';
}
// Replace WooComemrce button class with Bootstrap
/*add_filter('woocommerce_loop_add_to_cart_link', 'dazzling_commerce_switch_buttons');
function wbst_commerce_switch_buttons( $button ){
  $button = str_replace('button', 'btn btn-default', $button);
  return $button;
}*/
/*
Place a cart icon with number of items and total cost in the menu bar.
*/
function wbst_woomenucart($menu, $args) {
	// Check if WooCommerce is active and add a new item to a menu assigned to "Navbar Upper Right" (Primary Navigation Menu) location
	if ( !in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) || 'navbar-upper-right' !== $args->theme_location )
		return $menu;
	ob_start();
{'fraction_non_alphanumeric': 0.1494972490988427, 'fraction_numerical': 0.012521343198634035, 'mean_word_length': 5.094797687861272, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1858897', 'n_tokens_mistral': 1924, 'n_tokens_neox': 1835, 'n_words': 429}