Pricing API
The pricing API is used to retrieve the prices of products from Abacus and display them in the Shopware frontend in real time.
Backup price: When creating a product in Shopware, either through the full product sync, through a PIM integration or manually, a product price is required. We recommend using a default price in Shopware, which is then overwritten by the pricing API when the product is displayed in the storefront. In the unlikely event that the pricing API is not available, the default price will be used. This ensures that the product can still be displayed correctly in the storefront, even if the pricing API is not available.
Pricing API configuration
To configure the pricing API, go to the Shopware administration and open the Abacus integration plugin configuration.
Two options are available:
- Enable it for not logged in users: This will enable the pricing API for all users that are not logged in.
- Enable it for logged in users: This will enable the pricing API for logged in users
For the logged in users, we are using the abacus debtor number to identify the user which is saved in the custom fields of the customer entity.
How does it work in the frontend?
When a product is displayed in the storefront, the pricing API is called to retrieve the prices of the product. We hook into categories and product detail pages to display the prices in the storefront as well as in the cart due to price calculation that can be done in abacus on cart level.
💡 Caching: We recommend to use a dedicated Redis instance for caching shopware in general. We also cache the pricing API results in Redis to improve performance. Prices are cached for 60 minutes for logged in and non-logged in users.