'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
*
*/
// First let's 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);
// Now we can add our own, the same used for theme Pages
add_action('woocommerce_before_main_content', 'activello_wrapper_start', 10);
add_action('woocommerce_after_main_content', 'activello_wrapper_end', 10);
function activello_wrapper_start() {
echo '
';
echo '';
}
function activello_wrapper_end() {
echo '
';
}
// Replace WooComemrce button class with Bootstrap
add_filter('woocommerce_loop_add_to_cart_link', 'activello_commerce_switch_buttons');
function activello_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 activello_woomenucart($menu, $args) {
// Check if WooCommerce is active and add a new item to a menu assigned to Primary Navigation Menu location
if ( !in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) || 'primary' !== $args->theme_location )
return $menu;
ob_start();
global $woocommerce;
$viewing_cart = __('View your shopping cart', 'activello');
$start_shopping = __('Start shopping', 'activello');
$cart_url = $woocommerce->cart->get_cart_url();
$shop_page_url = get_permalink( woocommerce_get_page_id( 'shop' ) );
$cart_contents_count = $woocommerce->cart->cart_contents_count;
$cart_contents = sprintf(_n('%d item', '%d items', $cart_contents_count, 'activello'), $cart_contents_count);
$cart_total = $woocommerce->cart->get_cart_total();
// Uncomment the line below to hide nav menu cart item when there are no items in the cart
// if ( $cart_contents_count > 0 ) {
if ($cart_contents_count == 0) {
$menu_item = '