WooCommerce AJAX Fix for RD Theme Live Cart Update

const DEBUG = false; // Set to true to enable console logs for debugging (function checkJQueryThenRun(retries = 10) { if (typeof jQuery === ‘undefined’) { if (DEBUG) console.warn(‘⏳ Waiting for jQuery…’); if (retries > 0) { setTimeout(() => checkJQueryThenRun(retries –…Continue reading

Register Sortable AutomateWoo Order Table Template [Requires Child Theme Files]

/** * 1) Register custom AutomateWoo product display template * 2) Sort items alphabetically when that template is used */ /* ——————————————— * 1) Register the new template for {{ order.items }} * ——————————————- */ add_filter( ‘automatewoo/variables/product_templates’, ‘rd_aw_register_product_templates’, 10 );…Continue reading

[Do not push] AutomateWoo Custom Function Align Subscription Renewal Date

function rd_align_subscription_next_payment( $workflow ) { if ( ! class_exists( ‘WooCommerce’ ) || ! function_exists( ‘wcs_get_subscription’ ) ) { return; } $subscription = $workflow->data_layer()->get_subscription(); if ( ! $subscription || ! is_a( $subscription, ‘WC_Subscription’ ) ) { wc_get_logger()->error( ‘No valid subscription found…Continue reading

Move Email after Name in Checkout

add_filter( ‘woocommerce_checkout_fields’, ‘rd_email_first_for_checkout’ ); function rd_email_first_for_checkout( $checkout_fields ) { $checkout_fields[‘billing’][‘billing_email’][‘priority’] = 25; return $checkout_fields; }Continue reading

Keep All Checkout Data in WooCommerce Session

add_action( ‘woocommerce_checkout_update_order_review’, ‘bbloomer_save_checkout_values’, 9999 ); function bbloomer_save_checkout_values( $posted_data ) { parse_str( $posted_data, $output ); WC()->session->set( ‘checkout_data’, $output ); } add_filter( ‘woocommerce_checkout_get_value’, ‘bbloomer_get_saved_checkout’, 9999, 2 ); function bbloomer_get_saved_checkout( $value, $index ) { $data = WC()->session->get( ‘checkout_data’ ); if ( ! $data…Continue reading

HPOS Order Table – Internal Name (Nickname) Column

// 1. Add “Internal Name” column after the Order Number column in HPOS Orders Table add_filter(‘woocommerce_shop_order_list_table_columns’, function($columns) { $new_columns = []; foreach ($columns as $key => $label) { $new_columns[$key] = $label; if ($key === ‘order_number’) { // Insert custom column…Continue reading

HPOS Order Table – Internal Name (Nickname) Column

// 1. Add “Internal Name” column after the Order Number column in HPOS Orders Table add_filter(‘woocommerce_shop_order_list_table_columns’, function($columns) { $new_columns = []; foreach ($columns as $key => $label) { $new_columns[$key] = $label; if ($key === ‘order_number’) { // Insert custom column…Continue reading

Legacy Order Table – Internal Name (Nickname) Column

if ( function_exists(‘wc_get_container’) && ! wc_get_container()->get(\Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController::class)->custom_orders_table_usage_is_enabled() ) { // LEGACY ORDER TABLE SNIPPET HERE add_filter(‘manage_edit-shop_order_columns’, function($columns) { $new_columns = []; foreach ($columns as $key => $label) { $new_columns[$key] = $label; if ($key === ‘order_number’) { $new_columns[‘internal_name’] = ‘Internal Name’; }…Continue reading