Building a cross-browser compatible, multi-handle range slider

Range Inputs are HTML elements which let users select a numeric value between a specified minimum and maximum value. They support single values by default. As part of the WooCommerce Blocks project we’ve been working on converting WooCommerce widgets to Gutenberg blocks. One of those happens to be a price slider which currently uses jQueryContinue reading “Building a cross-browser compatible, multi-handle range slider”

I made a Super Mario Themed Nursery

Last year, before the birth of my first son, I was able to get creative and decorate the nursery. Being a huge fan of video games (and retro style graphics!) logically I chose a Super Mario theme for the room and set about making plans to create a large wall mural and other themed objectsContinue reading “I made a Super Mario Themed Nursery”

WooCommerce 3.3 – Hide uncategorized category from the shop page on the frontend

<?php // Do not include this if already open! /** * Code goes in theme functions.php. */ add_filter( 'woocommerce_product_subcategories_args', 'custom_woocommerce_product_subcategories_args' ); function custom_woocommerce_product_subcategories_args( $args ) { $args['exclude'] = get_option( 'default_product_cat' ); return $args; } view raw functions.php hosted with ❤ by GitHub

Small drop-in plugin to fix double-serialized product attributes (they are no longer double-unserialized in WC Core)

<?php /** * Plugin Name: Double serialized attributes fixer * Description: Adds a tool to fix double serialized attributes in WooCommerce. * Version: 0.0.9 * Author: Mike J * Requires at least: 4.4 * Tested up to: 4.7 */ if ( ! defined( 'ABSPATH' ) ) { exit; } add_filter( 'woocommerce_debug_tools', 'double_serialized_attributes_fixer_tool' ); function double_serialized_attributes_fixer_tool(Continue reading “Small drop-in plugin to fix double-serialized product attributes (they are no longer double-unserialized in WC Core)”

WooCommerce – Notify admin when a new customer account is created

<?php // Do not include this if already open! /** * Code goes in theme functions.php. */ add_action( 'woocommerce_created_customer', 'woocommerce_created_customer_admin_notification' ); function woocommerce_created_customer_admin_notification( $customer_id ) { wp_send_new_user_notifications( $customer_id, 'admin' ); } view raw functions.php hosted with ❤ by GitHub

WooCommerce – Hide price suffix when product is not taxable.

<?php // Do not include this if already open! /** * Code goes in theme functions.php. */ add_filter( 'woocommerce_get_price_suffix', 'custom_woocommerce_get_price_suffix', 10, 2 ); function custom_woocommerce_get_price_suffix( $price_display_suffix, $product ) { if ( ! $product->is_taxable() ) { return ''; } return $price_display_suffix; } view raw functions.php hosted with ❤ by GitHub

WooCommerce – Redirect external products offsite (disable single listings)

<?php // Do not include this if already open! /** * Code goes in theme functions.php. */ add_action( 'template_redirect', 'redirect_external_products' ); function redirect_external_products() { global $post; if ( is_singular( 'product' ) && ! empty( $post ) && ( $product = wc_get_product( $post ) ) && $product->is_type( 'external' ) ) { wp_redirect( $product->get_product_url() ); exit; }Continue reading “WooCommerce – Redirect external products offsite (disable single listings)”