Skip to main content

Cron Jobs

Several features require scheduled tasks (cron jobs) to run. All URLs are listed in Setup โ†’ Settings โ†’ Products at the bottom.


Why Cron Jobs?โ€‹

  • Abandoned cart emails - Sent only when the cron runs.
  • Back-in-stock notifications - Checked when the cron runs.
  • Price drop alerts - Checked when the cron runs.
warning

Without these crons, these features will not work.


Cron URLsโ€‹

FeatureURLRecommended
Abandoned cart emailshttps://yoursite.com/products/cron/abandoned_cart_emailsDaily
Back-in-stockhttps://yoursite.com/products/cron/back_in_stock_emailsDaily
Price drophttps://yoursite.com/products/cron/price_drop_emailsDaily

Replace yoursite.com with your actual domain.


How to Add to Crontabโ€‹

Linux / cPanelโ€‹

  1. Open your crontab: crontab -e
  2. Add lines like:
# Run daily at 9:00 AM
0 9 * * * curl -s "https://yoursite.com/products/cron/abandoned_cart_emails" > /dev/null 2>&1
0 9 * * * curl -s "https://yoursite.com/products/cron/back_in_stock_emails" > /dev/null 2>&1
0 9 * * * curl -s "https://yoursite.com/products/cron/price_drop_emails" > /dev/null 2>&1

Alternative: wgetโ€‹

0 9 * * * wget -q -O - "https://yoursite.com/products/cron/abandoned_cart_emails" > /dev/null 2>&1

PHP CLI (if curl/wget unavailable)โ€‹

0 9 * * * php -r "file_get_contents('https://yoursite.com/products/cron/abandoned_cart_emails');"

Cron Behaviorโ€‹

  • Each endpoint checks if its feature is enabled before running.
  • If disabled, it exits immediately.
  • Output is minimal (e.g., "Sent: X" for emails). No output usually means nothing to process or feature disabled.

Testingโ€‹

You can test by visiting the URL in a browser or running:

curl "https://yoursite.com/products/cron/abandoned_cart_emails"

You should see a short response (e.g., "Sent: 0" or "Disabled").


Support

If you need help with Perfex Shop, visit the Support Ticketing Area.