Giftrocket for SureCart Documentation

⌘K
  1. Home
  2. Docs
  3. Giftrocket for SureCart D...
  4. 10. Developers
  5. 10.1 Hooks and Filters

10.1 Hooks and Filters

GiftRocket provides actions and filters so developers can change its behaviour without editing plugin files.

Filters

FilterDefaultWhat it changes
giftrocketsure_apply_max_failed_attempts5Wrong codes allowed per IP before checkout is paused
giftrocketsure_apply_failed_attempts_window60Seconds the wrong-code counter lasts
giftrocketsure_max_custom_uploads_per_hour10Photo uploads per customer per hour
giftrocketsure_orphan_upload_grace_period7 days (seconds)How long unused uploads are kept (minimum 1 day)
giftrocketsure_orphan_upload_batch_size200Files checked per cleanup run
giftrocketsure_is_checkout_pageauto-detectedWhether the gift card field loads on the current page
giftrocketsure_productsarrayThe list of gift card products
giftrocketsure_epasscard_api_baseEpasscard production URLThe Epasscard API address
giftrocketsure_review_notice_screensarrayAdmin screens where the review request can appear

Example: allow 10 wrong codes per minute instead of 5.

add_filter( 'giftrocketsure_apply_max_failed_attempts', function () {
    return 10;
} );

Example: show the gift card field on a custom checkout page.

add_filter( 'giftrocketsure_is_checkout_page', function ( $is_checkout ) {
    return $is_checkout || is_page( 'my-checkout' );
} );

Actions

ActionArgumentsWhen it runs
giftrocket_order_processed$purchase_id, $purchaseWhen SureCart creates any purchase, before gift cards are issued
giftrocket_sure_cron_frequentnoneEvery 5 minutes: sends due scheduled emails
giftrocket_sure_cron_hourlynoneEvery hour: expiry reminders and cleanup
giftrocket_sure_dispatch_single_card$card_idAt a card’s scheduled delivery time

Note: Add custom code in a child theme’s functions.php or a code snippets plugin, never in the GiftRocket plugin folder, so updates don’t remove it.

How can we help?