Developer forum

Forum » Ecommerce - Standard features » Shop context in WebApi

Shop context in WebApi

Mario Santos Dynamicweb Employee
Mario Santos
Reply

Hi there,

One of our solutions has multiple shops and websites, which has their own products. Each website is poiting to a different shop, if we search for a product that does not belong to the current shop it is not returned by the query as expected

Although, when we do the same search using the WebAPI the product is returned, even sending the ShopId parameter.

 

It seems the ShopID macro is not getting properly set. Any thoughts?

 

BR Mario

 


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Mario

The Macro currently only reads the shopid from the area ecommerce settings - and there is no area context in the webapi. So you would need to match a parameter ShopID instead as an additional expression to filter it out.

I will take a look at changing the macro to pickup the shopid from querystring as well.

Votes for this answer: 1
 
Mario Santos Dynamicweb Employee
Mario Santos
Reply

Hi Nicolai,

I ended doing a OR clause to the querystring after I created this post - but yes if macro could do that magic would be great!

BR Mario

 

You must be logged in to post in the forum