Product Main Image Size – 800×800
add_filter(‘woocommerce_get_image_size_single’, function($size) { return array( ‘width’ => 800, ‘height’ => 800, ‘crop’ => 1, ); });Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
add_filter(‘woocommerce_get_image_size_single’, function($size) { return array( ‘width’ => 800, ‘height’ => 800, ‘crop’ => 1, ); });Continue reading
add_filter(‘woocommerce_gallery_thumbnail_size’, function ($size) { return array( ‘width’ => 150, ‘height’ => 150, ‘crop’ => 1, ); });Continue reading
add_filter( ‘woocommerce_cart_ready_to_calc_shipping’, function( $show_shipping ) { if ( is_cart() ) { return false; } return $show_shipping; }, 99 );Continue reading
add_filter(‘body_class’, ‘stw_add_cart_status_class’); function stw_add_cart_status_class($classes) { if (function_exists(‘WC’)) { $cart = WC()->cart; if (isset($cart) && is_callable(array($cart, ‘get_cart_contents_count’))) { $items = $cart->get_cart_contents_count(); $classes[] = $items?’cart_has_items’:’cart_is_empty’; } } return $classes; }Continue reading
function filter_woocommerce_cart_item_class( $string, $cart_item, $cart_item_key ) { // Get the product categories slugs for this item $term_slugs = wp_get_post_terms( $cart_item[‘product_id’], ‘product_cat’, array( ‘fields’ => ‘slugs’ ) ); // NOT empty if ( ! empty ( $term_slugs ) ) { $string…Continue reading
//shortcode for total of items in cart – no shipping/taxes/etc. add_shortcode( ‘quote-total’, ‘get_quote_total’ ); function get_quote_total(){ $total = WC()->cart->total; return wc_price($total); }Continue reading
//Change “shipping” to “Express Shipping” /* * add_filter( ‘woocommerce_shipping_package_name’, ‘custom_shipping_package_name’ ); function custom_shipping_package_name( $name ) { if ( current_user_can( ‘um_third-parties’ ) ) { return ‘Express Shipping’; } } */ // Remove shipping method title add_filter( ‘woocommerce_cart_shipping_method_full_label’, ‘bbloomer_remove_shipping_label’, 9999, 2 );…Continue reading
//Change the ‘Billing details’ checkout label to ‘Contact Information’ function wc_billing_field_strings( $translated_text, $text, $domain ) { switch ( $translated_text ) { case ‘Billing details’ : $translated_text = __( ‘Credit Card Address’, ‘woocommerce’ ); break; } return $translated_text; } function custom_override_checkout_fields(…Continue reading
function mysite_custom_define() { $custom_meta_fields = array(); $custom_meta_fields[‘billtorecnum’] = ‘billToRecNum’; return $custom_meta_fields; } function mysite_columns($defaults) { $meta_number = 0; $custom_meta_fields = mysite_custom_define(); foreach ($custom_meta_fields as $meta_field_name => $meta_disp_name) { $meta_number++; $defaults[(‘mysite-usercolumn-‘ . $meta_number . ”)] = __($meta_disp_name, ‘user-column’); } return $defaults;…Continue reading
// Enable Payment on account for third parties only (using cheque method) // Set available payment methods, based on category of products in cart add_filter( ‘woocommerce_available_payment_gateways’, ‘unset_gateway_by_category’ ); function unset_gateway_by_category( $available_gateways ) { if ( is_admin() ) return $available_gateways; if…Continue reading