add_action( 'init', 'custom_fix_thumbnail' ); function custom_fix_thumbnail() { add_filter('woocommerce_placeholder_img_src', 'custom_woocommerce_placeholder_img_src'); function custom_woocommerce_placeholder_img_src( $src ) { $upload_dir = wp_upload_dir(); $uploads = untrailingslashit( $upload_dir['baseurl'] ); $src = $uploads … [Read more...] about Woocommerce default featured placeholder image
Woocomm change backorder text
function so_42345940_backorder_message( $text, $product ){ if ( $product->managing_stock() && $product->is_on_backorder( 1 ) ) { $text = __( 'Avaliable on Pre-Order', 'your-textdomain' ); } return $text; } add_filter( 'woocommerce_get_availability_text', 'so_42345940_backorder_message', 10, 2 ); … [Read more...] about Woocomm change backorder text
Woocommerce sold out badge
//* Add sold out badge on archive pages add_action( 'woocommerce_before_shop_loop_item_title', function() { global $product; if ( !$product->is_in_stock() ) { echo 'Sold out'; } }); //* Add sold out badge on single product pages add_action( 'woocommerce_before_single_product_summary', function() { global $product; if … [Read more...] about Woocommerce sold out badge
Remove Woocommerce breadcrumbs
//* Remove Woocommerce breadcrumbs remove_action( 'woocommerce_before_main_content','woocommerce_breadcrumb', 20, 0); … [Read more...] about Remove Woocommerce breadcrumbs
Hide shipping rates when free shipping is available
/** * Hide shipping rates when free shipping is available. * Updated to support WooCommerce 2.6 Shipping Zones. * * @param array $rates Array of rates found for the package. * @return array */ function my_hide_shipping_when_free_is_available( $rates ) { $free = array(); foreach ( $rates as $rate_id => $rate ) { if ( … [Read more...] about Hide shipping rates when free shipping is available
Woocommerce – Change number of products displayed
// Display 48 products per page. Goes in functions.php add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 48;' ), 20 ); … [Read more...] about Woocommerce – Change number of products displayed
Woocommerce – reorder single product template
/** * woocommerce_single_product_summary hook * * @hooked woocommerce_template_single_title - 5 * @hooked woocommerce_template_single_rating - 10 * @hooked woocommerce_template_single_price - 10 * @hooked woocommerce_template_single_excerpt - 20 * @hooked woocommerce_template_single_add_to_cart - 30 * @hooked … [Read more...] about Woocommerce – reorder single product template
Woocommerce – Change SKU Text
function translate_woocommerce($translation, $text, $domain) { if ($domain == 'woocommerce') { switch ($text) { case 'SKU': $translation = 'Part No'; break; case 'SKU:': $translation = 'Part No:'; break; } } return … [Read more...] about Woocommerce – Change SKU Text