add_filter( ‘woocommerce_coupon_is_valid’, function( $valid, $coupon, $discount ) { // List the coupon codes to restrict (lowercase) $restricted_coupons = [ ‘your-coupon-code’ ]; if ( ! in_array( strtolower( $coupon->get_code() ), $restricted_coupons, true ) ) { return $valid; } // Allowed shipping method…Continue reading
add_filter( ‘woocommerce_coupon_is_valid’, ‘custom_category_subtotal_coupon_gate’, 20, 2 ); function custom_category_subtotal_coupon_gate( $valid, $coupon ) { $target_coupon = ‘your-coupon-code’; // lowercase coupon code $threshold = 5000.00; $category_ids = array( 12, 34 ); // replace with actual product category IDs if ( strtolower( $coupon->get_code() )…Continue reading
Lyfetyle — Honor Their Story Forever *,*::before,*::after{box-sizing:border-box;margin:0;padding:0} :root{ –ink:#1c1917; –warm:#f9f6f1; –gold:#b8973a; –gold2:#d4aa4a; –slate:#4a4540; –pale:#e8e2d9; –white:#ffffff; } html{scroll-behavior:smooth} body{font-family:’Inter’,sans-serif;background:var(–warm);color:var(–ink);overflow-x:hidden} /* ── NAV ── */ nav{ position:fixed;top:0;left:0;right:0;z-index:200; padding:1.2rem 5vw; display:flex;align-items:center;justify-content:space-between; background:rgba(249,246,241,0.95);backdrop-filter:blur(16px); border-bottom:1px solid var(–pale); } .logo{ font-family:’Playfair Display’,serif; font-size:1.5rem;font-weight:700;letter-spacing:0.04em; color:var(–ink);text-decoration:none; display:flex;align-items:center; }…Continue reading
add_action( ‘wwlc_action_after_create_wholesale_lead’, function( WP_User $new_lead ) { // Retrieve opt-in meta matching the Custom Field ID configured in WWLC admin $opted_in = get_user_meta( $new_lead->ID, ‘klaviyo_subscribe’, true ); // Check both standard string and checkbox group array formats for the checked…Continue reading
/** * Recalculate the cart subtotal discount to exclude products that: * – belong to a specific product category e.g., ‘music’ , OR * – have an individual wholesale price set for the customer’s role. */ add_filter( ‘wwpp_cart_subtotal_based_discount’, ‘wwpp_recalculate_discount_for_eligible_items’ );…Continue reading
/** * Add Purchase Order Number field to Wholesale Payments at classic checkout. */ // 1. Render the field — visible only when Wholesale Payments is selected. add_action( ‘woocommerce_review_order_before_submit’, function () { ?>Continue reading
/** * Hide the “In Stock Amount” column in Wholesale Order Form for non-wholesale customers. * * Uses the wwof_order_form_body_meta filter to strip the in-stock-amount column * when the current user does not have a wholesale role. */ add_filter( ‘wwof_order_form_body_meta’,…Continue reading
/** * Helper: sum product-only sales (excludes shipping) for one affiliate. * Filters to WooCommerce context so the dataset matches the SALES table. */ function affwp_product_only_sales( $affiliate_id, $status_array ) { $total = 0.0; $referrals = affiliate_wp()->referrals->get_referrals( array( ‘affiliate_id’ => absint(…Continue reading