> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pureclarity.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Customer Specific Prices

> How to display customer-specific pricing in PureClarity recommendations using server-side mode in Magento 2.x

Customer-specific pricing that goes beyond standard Magento customer group pricing requires server-side mode to display accurate prices in PureClarity recommendations. This ensures complex pricing logic is applied correctly for each customer.

## When Customer Specific Pricing is Needed

### Complex Pricing Scenarios

**Beyond standard customer group pricing:**

* **Individual customer negotiations** - Unique pricing per customer
* **Contract-based pricing** - Special agreements and terms
* **Volume discounts** - Complex tier pricing based on purchase history
* **Dynamic pricing** - Real-time price calculations
* **Regional variations** - Location-based pricing adjustments
* **B2B custom catalogs** - Customer-specific product visibility

### Standard vs Custom Pricing

| Standard Customer Group Pricing | Customer Specific Pricing      |
| ------------------------------- | ------------------------------ |
| Predefined price tiers          | Individually negotiated prices |
| Group-based discounts           | Customer-unique discounts      |
| Feed-based delivery             | Real-time calculation          |
| Client-side display             | Server-side processing         |

<Note>
  If your pricing fits within Magento's standard customer group system, consider using the "Send Customer Group Pricing" option in [Data Feeds & Indexing](/integrations/magento/magento-2/data-feeds-indexing) instead of server-side mode.
</Note>

## Server-Side Mode Requirement

### Why Server-Side Mode is Necessary

**Technical limitations of client-side mode:**

* **Static pricing** - Only default prices sent in feeds
* **No real-time calculation** - Prices determined at feed generation
* **Limited personalization** - Cannot access current customer context
* **No complex logic** - Advanced pricing rules not supported

**Server-side mode capabilities:**

* **Real-time pricing** - Calculated when recommendations display
* **Customer context** - Access to current customer data
* **Complex logic** - Custom pricing rules and calculations
* **Live inventory** - Current stock levels and availability
* **Security** - Sensitive pricing logic stays on your server

<Warning>
  Server-side mode requires additional development work and may impact page load performance. Only implement when customer-specific pricing is essential for your business model.
</Warning>

## Configuring Server-Side Mode

### 1. Enable Server-Side Mode

Navigate to **Stores > Configuration > PureClarity > Mode**:

1. Set **Mode** to **"Serverside"**
2. **Save configuration**
3. **Clear configuration cache**

<img src="https://mintlify.s3.us-west-1.amazonaws.com/pureclarity/images/magento/server-side-mode-selection.webp" alt="PureClarity mode configuration showing Serverside option selected" />

For detailed mode configuration, see [Configuration Mode Guide](/integrations/magento/magento-2/configuration-mode).

### 2. Update Zone Implementation

Change zone HTML to use server-side syntax:

**Before (Client-side):**

```html theme={null}
<div data-pureclarity="bmz:ZONE-ID;"></div>
```

**After (Server-side):**

```html theme={null}
<div data-serverside-pureclarity="bmz:ZONE-ID" 
     data-pureclarity-bmz-id="ZONE-ID" 
     class="pc_bmz" />
```

<Info>
  All existing zones must be updated to use server-side HTML syntax. Mixing client-side and server-side zones on the same page can cause conflicts.
</Info>

## Implementation Requirements

### 3. Custom Pricing Logic Development

Server-side mode requires custom development to implement your pricing logic:

**Development areas:**

* **Price calculation plugins** - Custom pricing algorithms
* **Customer context access** - Retrieving customer-specific data
* **Template customization** - Displaying calculated prices
* **Performance optimization** - Efficient price calculation

**Example implementation structure:**

```php theme={null}
// Custom plugin for price calculation
class CustomerSpecificPricing
{
    public function afterGetFinalPrice($subject, $result)
    {
        $customer = $this->customerSession->getCustomer();
        
        // Apply customer-specific pricing logic
        return $this->calculateCustomPrice($customer, $result);
    }
    
    private function calculateCustomPrice($customer, $basePrice)
    {
        // Your custom pricing logic here
        return $customPrice;
    }
}
```

### 4. Template Customization

Customize PureClarity templates to display customer-specific pricing:

**Template development tasks:**

* **Price display logic** - Show appropriate prices for each customer
* **Formatting consistency** - Match site's price display standards
* **Currency handling** - Multi-currency support if needed
* **Responsive design** - Ensure templates work across devices

## Customer Group Pricing Alternative

### Standard Customer Group Support

Before implementing full server-side mode, consider if customer group pricing meets your needs:

**Magento customer group pricing:**

* **Predefined tiers** - Bronze, Silver, Gold customer levels
* **Percentage discounts** - Group-based discount percentages
* **Fixed price tiers** - Set prices for customer groups
* **Catalog rules** - Automated pricing rules

**Enable customer group pricing:**

1. Navigate to **Stores > Configuration > PureClarity > Data Feeds / Indexing**
2. Set **"Product Feed - Send Customer Group Pricing"** to **"Yes"**
3. **Save configuration**
4. **Run product feeds** to include group pricing

<Tip>
  Customer group pricing provides personalization without the complexity of server-side mode. Test this approach first to see if it meets your requirements.
</Tip>

## Performance Considerations

### Server-Side Mode Impact

**Performance implications:**

* **Increased server load** - Price calculations on each recommendation request
* **Database queries** - Additional customer data retrieval
* **Page load time** - Potential delays during price calculation
* **Caching challenges** - Customer-specific content difficult to cache

**Optimization strategies:**

* **Efficient queries** - Optimize database performance
* **Caching layers** - Cache pricing data where possible
* **Asynchronous loading** - Load recommendations after initial page
* **Resource monitoring** - Track server performance impact

### Scaling Considerations

**High-traffic planning:**

* **Server resources** - Adequate CPU and memory allocation
* **Database optimization** - Indexed customer and pricing tables
* **Load balancing** - Distribute recommendation processing
* **Monitoring setup** - Track performance metrics

## Testing and Validation

### 5. Test Customer-Specific Pricing

**Testing workflow:**

1. **Create test customers** with different pricing requirements
2. **Configure pricing rules** for test scenarios
3. **Test recommendations** for each customer type
4. **Verify price accuracy** against expected calculations
5. **Test performance** under load

**Validation checklist:**

* [ ] **Correct prices** displayed for each customer
* [ ] **Price formatting** matches site standards
* [ ] **Currency handling** works correctly
* [ ] **Performance acceptable** under normal load
* [ ] **Error handling** graceful for pricing failures

### 6. Monitor Performance Impact

**Key metrics to track:**

* **Page load times** - Compare before and after server-side implementation
* **Server response times** - Monitor recommendation processing speed
* **Database performance** - Track query execution times
* **Error rates** - Monitor pricing calculation failures

## Advanced Implementation

### Integration with External Systems

**ERP system integration:**

* **Real-time pricing APIs** - Connect to external pricing systems
* **Inventory synchronization** - Live stock level updates
* **Contract management** - Dynamic contract-based pricing
* **Account management** - Customer-specific catalog access

**API development considerations:**

* **Timeout handling** - Graceful fallbacks for slow APIs
* **Error recovery** - Fallback pricing when external systems fail
* **Caching strategies** - Balance freshness with performance
* **Security** - Secure API communication

### Custom Business Logic

**Advanced pricing scenarios:**

* **Time-based pricing** - Different prices by time of day/season
* **Quantity breaks** - Volume-based pricing tiers
* **Bundle pricing** - Special pricing for product combinations
* **Geographic pricing** - Location-based price variations

## Troubleshooting Customer Pricing

### Common Issues

**Prices not updating:**

* Verify server-side mode is enabled
* Check custom pricing logic implementation
* Review database queries for customer data
* Test with different customer accounts

**Performance problems:**

* Profile price calculation performance
* Optimize database queries
* Implement appropriate caching
* Monitor server resource usage

**Display inconsistencies:**

* Check template customizations
* Verify price formatting logic
* Test across different devices
* Validate currency handling

### Debug Testing

**Testing customer-specific scenarios:**

1. **Enable debug mode** to visualize zones
2. **Test with known customer accounts**
3. **Verify price calculations** manually
4. **Check server logs** for processing errors
5. **Monitor network requests** for API calls

## Related Resources

### Configuration Guides

* [Configuration Mode](/integrations/magento/magento-2/configuration-mode) - Client-side vs server-side mode
* [Data Feeds & Indexing](/integrations/magento/magento-2/data-feeds-indexing) - Customer group pricing option
* [Server-Side Mode](/integrations/magento/magento-2/serverside) - Detailed server-side implementation

### Implementation Support

* [Adding Zones Using HTML](/integrations/magento/magento-2/adding-zones-html) - Zone syntax for server-side mode
* [Zone Debug Mode](/integrations/magento/magento-2/zone-debug) - Testing zone placement

### Troubleshooting

* [Zones Not Showing](/integrations/magento/magento-2/zones-not-showing) - Zone display issues
* [Products Not Updating](/integrations/magento/magento-2/products-not-updating) - Data synchronization problems

## Summary

Customer-specific pricing in PureClarity recommendations requires:

1. **Server-side mode** configuration for real-time price calculation
2. **Custom development** to implement pricing logic
3. **Template customization** for proper price display
4. **Performance optimization** to handle additional processing
5. **Thorough testing** to ensure accuracy and performance

Consider standard customer group pricing as a simpler alternative before implementing full server-side customization. The complexity of server-side mode is justified when your pricing requirements cannot be met through standard Magento customer group functionality.
