Archives: Snips

Snip Description

Add custom field below order notes

The official WooCommerce documentation shows you how to add custom fields to the billing or shipping section of the checkout. 

This guide shows you how to add fields in the Order Notes section of the checkout.

Move the Yoast WordPress SEO Meta Box below the Product Data Box

Yoast is big and bossy, with it’s default meta box placement directly below the main content, it can break the flow of entering Product Data and confuse clients. Here’s a snippet to make it appear at the bottom, below the Product Data meta box, ensuring a nice flow and grouping of WooCommerce Data

Change the “Ship to a different address?” default state

There’s an interesting discussion in WooCommerce Issue #2571. regarding the default state of the “Deliver to a different address” checkbox.

For a less cluttered checkout screen and from a UX view point, we could uncheck it by default

How to hide the single product page

This will hide the single product page the proper WordPress way by making the product not public. Pop this into your functions.php file. add_filter( ‘woocommerce_register_post_type_product’,’hide_product_page’,12,1); function hide_product_page($args){ $args[“publicly_queryable”]=false; $args[“public”]=false; return $args; }  

WooCommerce GDPR

An excellent article on WooCommerce (and WordPress) GDPR – https://businessbloomer.com/how-to-make-a-woocommerce-website-gdpr-compliant-12-steps/

Disable deferred/transaction email sending

WooCommerce 3 now defers sending of emails such as the new order emails. The idea that moving them out from the procedural code allows for faster checkouts in many environment. Nice.

Bring back “Remove all data”

The rather dangerous “Remove all data” checkbox in WooCommere was removed in WooCommerce 3.

No need to add a plugin, here’s how to bring back this functionality. 

Pretty logs in WooCommerce

One of the changes in WooCommerce 2.7 is an improved log system. Along with that came an option to change from text files to database logging. It lets us view, filter and sort logs right from the admin area. It comes with a shiny new interface on the WooCommerce admin status page.