Scripts + Launchpad setup to Functions

Topic summary

A merchant is transitioning from Shopify Scripts + Launchpad to Functions and facing two key challenges:

Current Setup:

  • Uses Launchpad to schedule sales events that trigger Scripts
  • Line item script blocks discount codes and displays checkout messages
  • Shipping script hides specific methods (e.g., express shipping)

Migration Issues:

  1. Customer feedback: Functions enforce rules (like quantity limits) silently without displaying explanatory messages in cart or checkout. The merchant needs a way to communicate why restrictions apply.

  2. Scheduling/automation: Unlike Scripts with Launchpad, Functions cannot be automatically activated/deactivated based on scheduled events, requiring manual toggling.

Proposed Solutions:

  • For messaging: Theme-dependent—cart responses should display limit messages when customers exceed restrictions
  • For scheduling: Use cart.shop.localTime.dateTimeBetween to apply time-based validations within Functions
  • Leverage input query variables to dynamically configure datetime parameters through a UI

The discussion remains open regarding best practices for replicating the full Scripts + Launchpad workflow with Functions.

Summarized with AI on October 24. AI used: claude-sonnet-4-5-20250929.

Hi, I currently use Shopify Scripts together with Launchpad to schedule and manage sales events. When a sale starts (via Launchpad), two scripts are activated:

  • A line item script that blocks discount codes during the sale and displays a checkout message to customers explaining that discount codes aren’t available.

  • A shipping script that hides certain shipping methods (e.g. “express”).

I’ve started experimenting with Functions:

  • For line items, I successfully limited quantities (max 10 per product), but I couldn’t find a way to show a message or explanation to the customer. The Function silently enforces the limit without feedback in the side cart or checkout.

  • For shipping, I can hide methods, but I can’t schedule or automate this with Launchpad—I need to toggle it manually.

My concerns are:

  1. With Functions, how can we provide clear feedback to customers when rules are applied (e.g. quantity limit, discount codes blocked)?

  2. Is there any way to schedule or automate Functions so they activate/deactivate with events (like Launchpad does with Scripts)?

Any guidance or best practices for these use cases would be greatly appreciated!

Thank you,
Cecilia

1 Like

For the quantity limit messages showing, I believe it depends on the theme you’re using on how it handles the response to adding items to the cart, the message should appear in the response in the browser to hitting that limit when you try adding an item beyond your limit.

For scheduling or automating the application of Functions, you can make use of cart.shop.localTime.dateTimeBetween to check and apply validations, delivery customizations, or other between two given datetimes.

You can also use input query variables to dynamically set these as input to your function so you can update these values in a configuration UI style experience.