In certain cases, the WooCommerce plugin will update, but the WooCommerce database update will fail. This mismatch between the WooCommerce database and WooCommerce can cause quite a few potential issues. To solve this, the WooCommerce database can be updated through the command line. wp wc update…
Snip Description
Make Restock refunded items unchecked by default
A quick one to automatically uncheck the “Restock refunded items” in the WooCommerce Order Admin by default. Doing this can save a few human errors in certain circumsances.
Remove WooCommerce DB Notices
Sometimes WooCommerce gets stuck showing admins the same notices over and over, even when the action has been completed. WooCommerce database update done is a common culprit. One solution is to manually mark the actions as “actioned” in the database. You’ll find a table wp_wc_admin_notes where…
Change any payment gateway icon
Change any payment gateway icon with this piece of code that goes into your functions.php
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.
Skip the cart page and combine the cart and checkout pages
For a super sleek checkout experience, we can combine the cart and checkout pages together very easily.
How to redirect directly to the product page when the category only holds one item
How to redirect directly to the product page when the category only holds one item
Disable WooCommerce SKU functionality
Here is a quick and easy one-liner to disable the WooCommerce SKU functionality completely.
Disable WooCommerce Nag Messages
Bored of seeing “Connect your store…” nag messages? Are they confusing your clients?
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; }
Change default sorting for a specific Woocommerce product category archive pages
WooCommerce only has a setting to change the sort order of all product archive pages, occasionally you may want to change default sorting for a specific Woocommerce product category archive pages. For example your store may be set to show products by Popularity by default, however,…
Add custom items to LD JSON Schema
This snippet will allow you to add custom items to LD JSON Schema generated by WooCommerce
WooCommerce GDPR
An excellent article on WooCommerce (and WordPress) GDPR – https://businessbloomer.com/how-to-make-a-woocommerce-website-gdpr-compliant-12-steps/
Hide product prices in selected categories
This little snippet will allow you to hide product prices in selected categories.
Hide uncategorized category from the shop page on the frontend
Hide uncategorized category from the shop page on the frontend
Add Payment Method Column to Admin Orders
Add Payment Method Column to Admin Orders
Reduce the strength requirement for customers passwords
The complex passwords in WooCommerce are a great concept – except when it annoys your customers into leaving the store due to inability to set a secure password.
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.