In order to enable context (e.g. add different prices or links depending on user location or any other context information), you will have to make corresponding changes in your CSV file (the information file you are uploading into your PIM account), as well as in your integration code.
Adding context information to your integration
You need to add certain parameters to your integration code using Wizart Web Visualizer: integration :
You need to add the following parameter to the piece of the code highlighted on the screenshot above:
+ '&context=string
The result you are supposed to get:
const fittingRoomEndpoint = server_address + '/fitting-room' + '?api_token=' + api_token + '&bba=true' + '&context=string ;
Adding context when using the iframe method
For example, you have SiteAB, SiteBC, SiteDE:
Article Context | Article_promotional_price | Name |
“SiteAB, SiteBC, SiteDE“ | “50,220,50“ | Article1 |
“SiteAB, SiteBC“ | “51,221“ | Article2 |
“SiteAB“ | “52“ | Article3 |
For this src:
https://pim-client.wizart.tech/fitting-room?api_token=your_API_token&en all products will be displayed.
<iframe id="wizart-fitting-room-object" role="dialog" aria-label="Wizart Fitting Room." type="text/html" class="active" src="https://pim-client.wizart.tech/fitting-room?api_token=your_API_token&en" allowfullscreen > </iframe>
2. For src: https://pim-client.wizart.tech/fitting-room?api_token=your_API_token&en&context=SiteAB
product Article1 (Article_promotional_price = 50), Article2 (Article_promotional_price = 51), Article3 (Article_promotional_price = 52) will be displayed.
<iframe id="wizart-fitting-room-object" role="dialog" aria-label="Wizart Fitting Room." type="text/html" class="active" src="https://pim-client.wizart.tech/fitting-room?api_token=your_API_token&en&context=SiteAB" allowfullscreen > </iframe>
3. For src: https://pim-client.wizart.tech/fitting-room?api_token=your_API_token&en&context=SiteBC
products Article1 (Article_promotional_price = 220), Article2 (Article_promotional_price = 221) will be displayed.
<iframe id="wizart-fitting-room-object" role="dialog" aria-label="Wizart Fitting Room." type="text/html" class="active" src="https://pim-client.wizart.tech/fitting-room?api_token=your_API_token&en&context=SiteBC" allowfullscreen > </iframe>
4. For src: https://pim-client.wizart.tech/fitting-room?api_token=your_API_token&en&context=SiteDE
products Article1 (Article_promotional_price = 50) will be displayed.
<iframe id="wizart-fitting-room-object" role="dialog" aria-label="Wizart Fitting Room." type="text/html" class="active" src="https://pim-client.wizart.tech/fitting-room?api_token=your_API_token&en&context=SiteDE" allowfullscreen > </iframe>
This way you can control the visibility of the products on the website and the prices (any context-sensitive attribute (!if you have any context attribute except Article_context) for them).
Adding context when using Deployment Kit