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

Removing Scheduled Actions from WooCommerce Action Scheduler

Woocommerce Stuck Action Scheduler

The Scheduled Actions that sit in WooCommerce Action Scheduler can get stuck with thousands of actions piling up, just stuck in a failed, canceled, pending or complete state. This can result in bloated database tables in particular wp_actionscheduler_actions and wp_actionscheduler_logs tables.   Since the states of failed, canceled or complete are already passed, you would be…

Read More

Change WooCommerce Sold Out text

Woocommerce Sold Out Text

You can change WooCommerce ‘Sold Out’ text set by the inventory setting of Sold Out with the WooCommerce filter woocommerce_get_availability_text Add the below snippet with your custom sold text to functions.php add_filter(‘woocommerce_get_availability_text’, ‘themeprefix_change_soldout’, 10, 2 ); /** * Change Sold Out Text to Something Else */ function themeprefix_change_soldout ( $text, $product) { if ( !$product->is_in_stock()…

Read More

Fix Google Search Console Coverage Errors – WooCommerce

Google Search Console Coverage Errors

Google Search Console alerts users when certain pages submitted in the sitemap are set to no-index and generates a coverage error, this can include WooCommerce pages like… /cart /checkout /my-account /?-add-to-cart These pages shouldn’t be cached or indexed and are correctly set to noindex, to remove the Search Console error you can add these pages…

Read More