Description Telegram New Products Notifier for ocStore
This PHP script automatically sends notifications about new products from the ocStore 3.0.3.7 database to the Telegram channel.
Main functions:
- Search for new products – the script checks the database for products that have not been sent yet.
- Category filtering – sends only products from allowed categories ($allowed_categories).
- Message limit – you can configure how many products to send in one run ($message_limit).
- Repeat protection – saves the ID of sent products to a file (last_sent_product_id.txt).
- Message formatting – includes the name, description, price, and link to the product.
- Security – uses file locking (flock) to prevent conflicts when running in parallel.
Settings and where to get them:
1. Database settings (ocStore 3.0.3.7)
$db_host – DB host (usually localhost).
$db_name – store database name.
$db_user – DB user.
$db_pass – user password.
Where to get it?
Config.php file in the root of ocStore or in the /system/storage/ folder.
2. Telegram settings
$bot_token – bot token (get from @BotFather).
$chat_id – chat/channel ID (can be found via @getmyid_bot).
3. Basic script settings
$last_sent_file – path to the file where the IDs of sent products are stored.
$message_limit – how many products to send per run (default 1).
$max_ids_in_file – ID storage limit in the file (so that it does not grow).
$base_site_url – main site URL (for example, https://your-site.com/).
$allowed_categories – array of allowed category IDs (can be obtained from the oc_category table).
How to use?
Create a Telegram bot via @BotFather and add it to the channel.
Configure access to the database (check login/password in config.php ocStore).
Run the script on a schedule (via Cron)








