• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP Bitz

A curated collection of code snippets for WordPress

  • Home
  • About
  • Blog
  • Code Snippets
You are here: Home / Archives for woocommerce

woocommerce

Horizontal Navigation Menu for WooCommerce My Account Page

January 4, 2022

@media only screen and (min-width: 769px) { .woocommerce-account .woocommerce-MyAccount-content, .woocommerce-account …

Continue Reading

Get order ID, customer shipping and billing information from WooCommerce database (MySQL query)

December 28, 2021

SELECT p.ID as order_id, p.post_date, max( CASE WHEN pm.meta_key = '_billing_email' and p.ID = pm.post_id THEN pm.meta_value …

Continue Reading

Get an array of variation IDs for a given product ID (all possible variations)

December 22, 2021

$product = wc_get_product( $product_id ); $variation_ids = $product->get_children(); …

Continue Reading

Get an array of variation IDs for a given product ID (visible variations only)

December 22, 2021

$product = wc_get_product( $product_id ); $variations = $product->get_available_variations(); $variation_ids = wp_list_pluck( …

Continue Reading

Extract data attributes from WooCommerce html tag

August 4, 2021

/** * Extraction utility to get attributes from an HTML tag. * * Example given defaults to WooCommerce "data-" attributes, but you …

Continue Reading

Decrease Password Strength Requirements for WooCommerce

June 17, 2020

/** * Change WooCommerce required password strength. * * WooCommerce password strength requirement is determined by an integer …

Continue Reading

Remove WooCommerce Password Strength Meter

June 17, 2020

add_action( 'wp_print_scripts', 'my_woo_remove_password_strength', 10 ); function my_woo_remove_password_strength() { …

Continue Reading

Set user role to WordPress default role during WooCommerce checkout

May 28, 2020

add_filter( 'woocommerce_new_customer_data', 'my_custom_user_data'); function my_custom_user_data( $new_customer_data ) { …

Continue Reading

Set custom user role during WooCommerce checkout

May 28, 2020

add_filter( 'woocommerce_new_customer_data', 'my_custom_user_data'); function my_custom_user_data( $new_customer_data ) { …

Continue Reading

Primary Sidebar

Join for free!

Get free code snippets, WordPress best practices, and practical Content Marketing advice from seasoned WordPress expert Chad Butler (butlerblog):

Recent Posts

  • Bitnami WordPress Autoptimize cannot write to the cache directory
  • Create and delete WordPress sites in XAMPP with a batch file
  • How to fix “Error: MySQL Shutdown Unexpectedly” in XAMPP control panel
  • Fix missing Customizer in WordPress 6
  • Use Proofy.io API to validate WordPress registrations

Copyright © 2023 · Maker Pro on Genesis Framework · WordPress · Log in