Pricing levels
If your store is using several pricing levels and the prices that your end-users see are dependent on their assigned pricing level, we will follow this solution to render correct prices.
Note that this solution is only applicable if the number of pricing levels is finite and relatively small (up to 20 pricing levels). The more complex pricing scenarios can be solved using the Pricing API.
This solution consists of 2 parts.
Identify all prices for the product
In the data you are pushing to Luigi's Box (applies to both the API and feeds) you will include the prices for all of the pricing levels, for every product. See example below for a reference.
<product>
<price_level_1>13.9 EUR</price_level_1>
<price_level_2>13.9 EUR</price_level_2>
<price_level_3>12.8 EUR</price_level_3>
</product>
{
fields: {
price_level_1: 13.9
price_level_2: 13.9
price_level_3: 12.8
}
}
This example shows scenario for 3 pricing levels, if your particular case involves more levels, enumerate prices for all of them. Make sure to identify every pricing level with a unique identifier. This example identifies pricing levels with a numerical ID, but it's possible to use text labels, such as in the example below.
<product>
<price_level_regular>13.9 EUR</price_level_regular>
<price_level_gold_membership>13.9 EUR</price_level_gold_membership>
<price_level_vip>12.8 EUR</price_level_vip>
</product>
{
fields: {
price_level_regular: 13.9
price_level_gold_membership: 13.9
price_level_vip: 12.8
}
}
Identify user's pricing level
On the frontend, identify the pricing level that the user belongs to. You can use any of the options below, but make sure that you use the same pricing level identifier as in the product data. Referring to the example in this scenario that would be one of regular
, gold_membership
or vip
.
- Use a cookie to set the user's pricing level, e.g.
pricing_level=regular
. - Set a
meta
header in the HTML code<meta property="pricing_level" content="regular">