Untitled Snippet

document.addEventListener(“click”, (e) => { const pill = e.target.closest(“.rs-pill”); if (!pill) return; const row = pill.parentElement; row.querySelectorAll(“.rs-pill”).forEach(p => p.classList.remove(“active”)); pill.classList.add(“active”); });Continue reading

Replace APFWS Matching Product Notice

(function () { if (typeof window === ‘undefined’ || !document) return; // Exit if WooCommerce frontend scripts are not present. if (typeof window.wc_add_to_cart_params === ‘undefined’) return; // Exit if WooCommerce APFS is not present (guards by checking for its AJAX…Continue reading

RewardsWP — My Account Rewards Tab

/** * Plugin Name: RewardsWP — My Account Rewards Tab * Description: Adds a “My Rewards” tab to WooCommerce My Account that opens the rewards widget. * Version: 1.0.0 * Author: AffiliateWP */ if ( ! defined( ‘ABSPATH’ ) )…Continue reading

Remove the coupon section for orders that did not use any coupon.

add_action( ‘woocommerce_email_before_order_table’, ‘conditionally_remove_coupon_section_from_email’, 5, 4 ); function conditionally_remove_coupon_section_from_email( $order, $sent_to_admin, $plain_text, $email ) { if ( ! $order instanceof WC_Order ) { return; } // Get applied coupons $coupons = $order->get_coupon_codes(); // If NO coupons were used, remove the coupon…Continue reading