Server-Side Mode Overview
How Server-Side Mode Works
- PureClarity provides SKUs - Recommendation algorithm returns product identifiers
- Magento processes SKUs - Server loads current product data with customer context
- Custom logic applied - Pricing rules, inventory, and business logic processed
- Template renders output - Knockout.js template displays final recommendations
- HTML delivered to page - Complete recommendation content served
Differences from Client-Side Mode
Template Management:- Server-side: Templates managed in Magento theme files
- Client-side: Templates managed in PureClarity admin
- Server-side: Real-time Magento data with customer context
- Client-side: Static data from pre-generated feeds
- Server-side: Full access to Magento functionality
- Client-side: Limited to feed data and PureClarity template editor
Changes made in PureClarity Admin’s Template Editor or Recommender Designer will not affect server-side mode displays. All template customization must be done in Magento.
Template Customization
Default Template Location
The product recommender template is located at:Override Template in Your Theme
To customize the template, copy it to your theme: Target location:Basic Template Structure
The template uses Knockout.js data binding:Available Data Fields
Standard product data available in templates:id- Product IDname- Product nameprice- Formatted price stringurl- Product page URLimage- Product image URLdescription- Product descriptionsku- Product SKU
- Custom attributes
- Calculated pricing
- Inventory information
- Customer-specific data
Custom Data Extension
Extension Point
Extend product data using plugins on theProductData class:
Class: \Pureclarity\Core\Model\Serverside\Response\ProductDataMethod:
populateProductData() - Adds data to the array sent to Knockout
Implementation Example
1. Create di.xml configuration:Advanced Custom Pricing Example
Advanced Template Customization
Responsive Design Template
Template with Custom Styling
Performance Optimization
Caching Strategies
Batch Processing
Error Handling and Fallbacks
Graceful Degradation
API Integration with Timeouts
Testing Server-Side Implementation
Unit Testing Custom Data
Integration Testing
Related Resources
Configuration and Setup
- Configuration Mode - Enabling server-side mode
- Customer Specific Prices - Pricing use cases
- Adding Zones Using HTML - Server-side zone syntax
Development Resources
- Extending Feeds - Related data customization
- Magento Logs - Debugging server-side processing
Troubleshooting
- Zones Not Showing - Server-side zone issues
- Products Not Updating - Data synchronization problems
Summary
Server-side mode implementation enables:- Custom pricing logic with real-time calculations
- Template customization through Magento theme system
- Data extension via plugin system
- Performance optimization through caching and batch processing
- Error handling with graceful degradation
