Download the PHP package pricemind/magento-connector without Composer
On this page you can find all versions of the php package pricemind/magento-connector. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pricemind/magento-connector
More information about pricemind/magento-connector
Files in pricemind/magento-connector
Package magento-connector
Short Description Tracks Magento price changes and sends them asynchronously to an external API.
License MIT
Informations about the package magento-connector
Pricemind Magento Module
A Magento 2 module that automatically tracks product price changes and synchronizes them with the Pricemind API for competitive price monitoring and analysis.
Features
- Real-time Price Tracking: Automatically detects and sends product price changes to Pricemind
- Special Price Support: Tracks special prices and their date ranges
- Custom Fields Integration: Syncs special price start/end dates as custom fields
- Multi-store Support: Website-level configuration for different stores
- Error Handling: Failed API requests are logged and stored for retry
- Non-blocking: Uses short timeouts to avoid disrupting store operations
- Secure Configuration: API keys are encrypted in the database
Requirements
- Magento 2.3+
- PHP 7.4+
- Active Pricemind account with API access
Installation
Via Composer (Recommended)
Manual Installation
- Download the module files
- Extract to
app/code/Stellion/Pricemind/
- Run the following commands:
Configuration
Admin Configuration
- Navigate to Stores → Configuration → Pricemind → API
- Configure the following settings:
API Settings
- Base URL: Pricemind API endpoint (default:
https://api.pricemind.io/
) - API Access Key: Your Pricemind API key in format
<key_id>.<version>.<secret>
- Channel: Select your Pricemind channel (populated after saving API key)
Source Detection
The module automatically detects and displays:
- Detected Source is Magento: Shows if the channel source is identified as Magento
- Source Type: The detected source type
- Source Title: The source title from Pricemind
Multi-store Configuration
The module supports website-level configuration:
- Set Configuration Scope to your desired website
- Configure API settings for each website independently
- Each website can use different Pricemind channels
How It Works
Price Change Detection
The module listens for the catalog_product_save_commit_after
event and detects changes in:
- Regular Price (
price
) - Special Price (
special_price
) - Special Price From Date (
special_from_date
) - Special Price To Date (
special_to_date
)
API Integration
When a price change is detected, the module:
-
Sends Price Data to
POST /v1/channels/{channelId}/prices
: - Sends Special Price Dates to
PUT /v1/custom-fields
:
Custom Fields Mapping
Special price date ranges are mapped to custom fields:
special_from_date
→special_price_start_date
special_to_date
→special_price_end_date
Error Handling
Failed API requests are stored in the stellion_pricemind_failed_request
table with:
- Request details (endpoint, method, headers, payload)
- Error message and status
- Retry count and next attempt timestamp
- Created/updated timestamps
Database Schema
The module creates one table:
stellion_pricemind_failed_request
Stores failed API requests for potential retry processing:
Column | Type | Description |
---|---|---|
entity_id |
INT | Primary key |
endpoint |
VARCHAR(255) | Target API endpoint |
method |
VARCHAR(16) | HTTP method |
headers |
TEXT | Request headers (JSON) |
payload |
TEXT | Request payload (JSON) |
error |
TEXT | Last error message |
retry_count |
INT | Number of retry attempts |
status |
SMALLINT | Status (0=pending, 1=retrying, 2=abandoned, 3=sent) |
next_attempt_at |
TIMESTAMP | Next retry timestamp |
created_at |
TIMESTAMP | Created timestamp |
updated_at |
TIMESTAMP | Updated timestamp |
API Endpoints Used
The module integrates with these Pricemind API endpoints:
GET /v1/channels
- Fetch available channelsGET /v1/channels/{id}/sources/active
- Get active channel sourceGET /v1/channels/{id}/product-domain?sku={sku}
- Lookup product domainPOST /v1/channels/{id}/prices
- Create/update pricePUT /v1/custom-fields
- Update custom field values
Security
- API Key Encryption: API keys are encrypted using Magento's encryption service
- Masked Logging: API keys are masked in error logs as
***
- Short Timeouts: 1-2 second timeouts prevent long-running requests
- ACL Permissions: Admin configuration requires
Stellion_Pricemind::config
permission
Performance Considerations
- Non-blocking: Short timeouts (1s connect, 2s total) prevent blocking store operations
- Async Processing: Price updates are sent asynchronously during product saves
- Error Tolerance: Failed requests don't disrupt normal store functionality
- Selective Updates: Only sends data when prices actually change
Troubleshooting
Common Issues
-
No price updates sent:
- Verify API key is configured and valid
- Check channel ID is selected
- Ensure product prices are actually changing
-
API connection errors:
- Verify Base URL is correct
- Check firewall/network connectivity
- Review error logs in
var/log/system.log
- Channel not loading:
- Save API key configuration first
- Check API key format:
<key_id>.<version>.<secret>
- Verify API key has channel access
Logging
The module logs events with the prefix [Stellion_Pricemind]
:
- Warnings: Non-2xx API responses, send failures
- Errors: API key decryption failures, channel fetch errors
Check logs in:
var/log/system.log
var/log/exception.log
Failed Requests
Monitor failed requests in the database:
Development
Module Structure
Extending the Module
To extend functionality:
- Add Custom Fields: Modify the observer to send additional product attributes
- Retry Logic: Implement cron job to retry failed requests
- Bulk Updates: Add CLI command for bulk price synchronization
- Webhooks: Add webhook endpoint for bidirectional sync
Support
For technical support or feature requests:
- Create an issue in the project repository
- Contact Pricemind support team
- Review the Pricemind API documentation
License
This module is released under the MIT License. See LICENSE file for details.
Changelog
Version 1.0.0
- Initial release
- Real-time price change tracking
- Special price and date range support
- Multi-store configuration
- Error handling and logging
- Failed request storage
All versions of magento-connector with dependencies
magento/framework Version *
magento/module-catalog Version *
magento/module-store Version *
magento/module-config Version *