Skip to main content

Need help ASAP - Limiting Multiple Purchases

I am launching a festival ticketing site and our purchase window opens imminently. I have a critical requirement that I am struggling to implement safely without crashing my site.

The Goal: I need to restrict customers to buying exactly ONE of each specific item, forever.

  • If a user buys a "General Admission" ticket, they can never buy it again.
  • If they return to the store later to grab an add-on, the "General Admission" ticket should be completely hidden from the store grid (or at least strictly blocked from being added to the cart), but they should still see and be able to buy an "Early Entry Pass".

The Technical Roadblock: I tried writing a custom PHP script to query the user's order history using the Customer and Order models, and then used the rest_request_before_callbacks filter to block the cart addition, combined with JS to hide it from the DOM. Unfortunately, querying the database this way keeps crashing my site.

help pls <3

Kyle Dee

Just updating this in case anyone else runs into the same nightmare! The core issue was that because I'm using a page builder (Breakdance), trying to filter the FluentCart product query directly via PHP was either getting ignored by the builder's cache or crashing the site due to rendering conflicts.

I ended up solving it with a hybrid approach. For the frontend, I safely queried the user's past orders and passed those IDs to a simple JavaScript snippet in the footer, which instantly finds and removes the purchased item's HTML card from the DOM after the page loads. Then, for security, I used a backend PHP hook on fluent_cart/can_add_to_cart to block the transaction just in case someone tries to use a direct link or disables JS.

Scott Hopkins

Kyle DeeΒ so stressful !! happy you could solve !