2/18/2017 - 3:48 PM

WooCommerce snippets

WooCommerce snippets

WooCommerce snippets

Frontend Snippets

Add a surcharge to cart and checkout – uses fees API

Customize the WooCommerce breadcrumb

Automatically Complete Orders (functions.php)

Add a message above the login / register form (functions.php)

Allow HTML in term (category, tag) descriptions (functions.php)

Change the default state and country on the checkout (functions.php)

Override loop template and show quantities next to add to cart buttons (functions.php)

Custom tracking code for the thanks page (functions.php)

Make address fields wider (functions.php)

Exclude products from a particular category on the shop page (functions.php)

Set a custom add to cart URL to redirect to (functions.php)

Custom sorting options (asc/desc) (functions.php)

Make price widget draggable on touch devices (functions.php)

Editing product data tabs (functions.php)

Hide sub-category product count in product archives (functions.php)

Remove product content based on category (functions.php)

General Snippets

Access WC variables (functions.php)

//* Get global WC object
global $woocommerce;

//* Access various WooCommerce cart variables, see also

//* Access various WooCommerce customer variables, see also @see

Forward all WC email notifications (functions.php)

//* Forward all WC email notifications
add_filter( 'woocommerce_email_headers', 'nl_forward_wc_email_notifocations', 10, 2);
function nl_forward_wc_email_notifocations($headers, $object) {
    $headers   = array();
    $headers[] = 'Bcc: Niels Lange <>';
    $headers[] = 'Content-Type: text/html';

    return $headers;

Theming Snippets