# Gallery: lightbox disabled but main image opens after variation (mobile)

**Date**: 2026-04-06  
**Support Ticket**: SUP-24198

## Symptom

On mobile, after selecting a variable option, tapping the main gallery image opened the full image / lightbox even when **Disable lightbox for sliders** was on (`no-venobox`).

## Root cause

1. **`bodycommerce_print_variable_product_gallery_sync_script()`** (`includes/core/frontend-scripts.php`, SUP-24126) updates `.woocommerce-product-gallery__image a` with the variation full image URL. BodyCommerce vertical/horizontal galleries use that class on the main slide, so **`href` was restored** after the gallery’s one-time `removeAttr('href')` on load.

2. WooCommerce’s own variation handler can also set `href` on gallery links. A deferred strip after `found_variation` runs after synchronous handlers complete.

## Fix

- **`applyToAnchor`**: Do not set `href` when the anchor has class `no-venobox`.
- **`Gallery.php`**: When lightbox is disabled for sliders, after `found_variation` and `reset_data`, `setTimeout(…, 0)` removes `href` from `.no-venobox` (scoped to module `css_class`), excluding `.video-slide`.

## Files

- `includes/core/frontend-scripts.php`
- `includes/modules/Gallery/Gallery.php`

## Notes

- Fixed incorrect `event` vs `e` in `.main-gallery-video.video-popup` handlers (horizontal, vertical, single) so preventDefault applies to the real event object.
