From 7d677dfa896ba2bb5a1f944ea58924a889d1a678 Mon Sep 17 00:00:00 2001 From: Brandon Li Date: Wed, 2 Sep 2026 21:39:15 -0500 Subject: [PATCH] Click the terms checkboxes directly, not the required row .validate-required is on every required checkout field, so the old selector's first match was usually a text input, and on the terms row the click landed in the empty half of a full-width

beside the box. Target the checkbox input in a required row and gate on :not(:checked) so the two clicks tick box one then box two instead of toggling the same box twice; the second is skipIfNotFound in case a checkout has only one. Co-Authored-By: Claude Opus 4.8 --- lib/automations.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/automations.ts b/lib/automations.ts index bdbdced..6ceabb0 100644 --- a/lib/automations.ts +++ b/lib/automations.ts @@ -288,8 +288,16 @@ export const FIRMS: Firm[] = [ { action: 'click', selector: 'input#coupon_code, input[name="coupon_code"], input#coupon_code_field', frame: '#woocommerceModal iframe', label: 'Focus coupon field' }, { action: 'type', selector: 'input#coupon_code, input[name="coupon_code"], input#coupon_code_field', frame: '#woocommerceModal iframe', text: 'THEPROPFARM', label: 'Enter coupon' }, { action: 'click', selector: 'button#apply_coupon_button', frame: '#woocommerceModal iframe', label: 'Apply coupon' }, - { action: 'click', selector: '.validate-required:not(.woocommerce-validated)', frame: '#woocommerceModal iframe', label: 'Agree to terms' }, - { action: 'click', selector: '.validate-required:not(.woocommerce-validated)', frame: '#woocommerceModal iframe', label: 'Agree to terms 2' }, + // Target the checkbox itself, not the .validate-required + // row: that class is on every required field (name, email, + // …), so its first match is usually a text input, and even + // on the terms row the click lands in the empty right half + // of a full-width

rather than on the box. `:not(:checked)` + // makes the two clicks self-sequence — the first tick checks + // box one, so the second click resolves to box two — and + // re-clicking never un-ticks a box already checked. + { action: 'click', selector: '.validate-required input[type="checkbox"]:not(:checked)', frame: '#woocommerceModal iframe', label: 'Agree to terms' }, + { action: 'click', selector: '.validate-required input[type="checkbox"]:not(:checked)', frame: '#woocommerceModal iframe', skipIfNotFound: true, label: 'Agree to terms 2' }, { action: 'waitFor', selector: '#woocommerceModal', absent: true, hidden: true, timeoutSeconds: 30, label: 'Wait for the modal to close' },