Change ‘Return To Store’ text button in WooCommerce
WooCommerce version 2.6 has brought out a new text filter that lets you change the text of ‘Return To Store’ on the button that appears on the cart page when the cart is empty. The filter is called woocommerce_return_to_shop_text and this is how you can use it. add_filter(‘woocommerce_return_to_shop_text’, ‘prefix_store_button’); /** * Change ‘Return to Shop’…
Read MoreCreate a WooCommerce Featured Products Loop of Featured Images
Here is a guide on how to create a WooCommerce featured products loop of featured images. The featured product option is chosen from the star column in the WordPress dashboard backend of the WooCommerce products, ‘featured‘ it is a term that belongs to the taxonomy named ‘product_visibility‘. View the code on Gist. So…
Read MoreCreate a slider of WooCommerce Product Featured Images
Here is how you can create a slider of WooCommerce product featured images using a jQuery slider. There are many slider scripts you can use, this one uses Slick Center Mode, this one from Slick adds a CSS class on the center image by which you can target with CSS and add in transition and…
Read MoreWooCommerce Only Show Free Shipping Rates
You can force WooCommerce to only show free shipping rates if the carts contents qualify and hide the other shipping rates with this code snippet below, which uses the woocommerce_package_rates filter, it goes in your themes functions.php file add_filter( ‘woocommerce_package_rates’, ‘prefix_hide_shipping_when_free_is_available’, 100 ); /** * Hide shipping rates when free shipping is available. * Updated…
Read MoreRename Home name and link in WooCommerce Breadcrumbs
You can change the Home name and home url link in WooCommerce breadcrumbs with 2 filters, woocommerce_breadcrumb_defaults and woocommerce_breadcrumb_home_url Change WooCommerce Home Text in Breadcrumb add_filter( ‘woocommerce_breadcrumb_defaults’, ‘prefix_change_breadcrumb_home_text’ ); /** * Rename “home” in WooCommerce breadcrumb */ function prefix_change_breadcrumb_home_text( $defaults ) { // Change the breadcrumb home text from ‘Home’ to ‘Shop’ $defaults[‘home’] = ‘Shop’;…
Read MoreRemove Product Tags from Products Post Type in WooCommerce
Here is a great snippet I came across to remove all product tags for the Product Custom Post Type in WooCommerce, it has 4 action/filters to remove the product tag metabox from the products posts, remove the tag column in the dashboard as well as removals in the dashboard menu and quick edit options. View…
Read MoreMove WooCommerce Product Long Description Into The Short Description Product Layout
How to move the woocommerce product long description text into the short description product layout with a couple of woocommerce actions and the long description tab removal. Remove The Description Tab This tab by default has the long product description. The above will remove all 3 tabs just comment out which if any tabs you…
Read MoreChange ‘You may also like’ and ‘You may be interested in’ WooCommerce text
The text strings ‘You may also like’ and ‘You may be interested in’ in WooCommerce can be changed with the gettext filter… add_filter( ‘gettext’, ‘bt_translate_like’ ); add_filter( ‘gettext’, ‘bt_translate_like_cart’ ); /** * @snippet Trsnslate “You may also like…” Text – WooCommerce * @how-to Watch tutorial @ https://businessbloomer.com/?p=19055 * @sourcecode https://businessbloomer.com/?p=595 * @author Rodolfo Melogli…
Read MoreShow thumbnail images in WooCommerce order emails
Thumbnail images can be shown in WooCommerce order emails with the filter woocommerce_email_order_items_args add_filter( ‘woocommerce_email_order_items_args’, ‘bt_email_order_items_args’, 10, 1 ); /** * WooCommerce * Show thumbs in Order Email sent to customers */ function bt_email_order_items_args( $args ) { $args[‘show_image’] = true; $args[‘image_size’] = array( 150, 150 ); return $args; } If you want the images to…
Read MoreAdding CSS styles into WooCommerce emails
WooCommerce emails can have CSS inline styles added via an action hook woocommerce_email_header, to add your CSS styles use the hook like below… add_action( ‘woocommerce_email_header’, ‘bt_add_css_to_email’ ); /** * WooCommerce * Add inline CSS to emails sent out */ function bt_add_css_to_email() { echo ‘ <style type=”text/css”> h1 { text-align: center !important; color: #c7c9c7; } </style></pre>…
Read More