Adding CSS styles into WooCommerce emails

Woocommerce Email Styles

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

Changing the WooCommerce coupon text in cart and checkout pages

Woocommerce Change Coupon Code Text

Want to change the WooCommerce coupon text… there are a few areas that need to be tackled namely the cart and the checkout pages, WooCommerce has most of the filters needed and the gettext filter can finish off translating the text string. add_filter( ‘gettext’, ‘bt_rename_coupon_field_on_cart’, 10, 3 ); add_filter( ‘woocommerce_coupon_error’, ‘bt_rename_coupon_label’, 10, 3 ); add_filter(…

Read More

Make price in WooCommerce an absolute value

Woocommerce Trim Price

You can make the prices displayed in WooCommerce an absolute value and remove the decimal .00 places with the WooCommerce woocommerce_price_trim_zeros filter. So for example to go from $50.00 to $50 In your functions.php add the following… /** * WooCommerce * Trim zeros in price decimals **/ add_filter( ‘woocommerce_price_trim_zeros’, ‘__return_true’ );

Read More

Change the WooCommerce return to shop and continue shopping URLs

woocommerce-shop-page

You can change the WooCommerce shop URL with a filter that WooCommerce provides, this can be helpful especially if you have a one product based shop and you want your users to return to that product and not the default shop page URL. The filter to use is aptly named – woocommerce_return_to_shop_redirect – add in your…

Read More

Remove WordPress site health dashboard and menu item

Wordpress Site Health

You can remove the WordPress site health dashboard widget and menu item with the following snippets Remove Site Health Dashboard Widget add_action(‘wp_dashboard_setup’, ‘themeprefix_remove_dashboard_widget’ ); /** * Remove Site Health Dashboard Widget * */ function themeprefix_remove_dashboard_widget() { remove_meta_box( ‘dashboard_site_health’, ‘dashboard’, ‘normal’ ); } Remove Site Health Menu Item add_action( ‘admin_menu’, ‘remove_site_health_menu’ ); /** * Remove Site…

Read More