RE: Add To Cart By Impersonate User

Olaf Kock, modified 3 Years ago. New Member Posts: 2 Join Date: 6/8/22 Recent Posts

Hello,

While working with lifereay-commerce 7.4.3.6-ga6, I am facing an issue. 

I want to impersonate the users and add products to cart on behalf of that users, but while performing this the products are being added to cart by admin user(but not as impersonate user).

Could anyone please provide some inputs on this.

Thanks.

thumbnail
Olaf Kock, modified 3 Years ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts

I'm considering impersonation a purely technical approach, as you're largely indistinguishable from the impersonated user account.

My recommendation would rather be to utilize accounts for this purpose.You can share a cart within an account.

thumbnail
Jeffrey Handa, modified 3 Years ago. Liferay Master Posts: 541 Join Date: 12/1/08 Recent Posts

Could you provide more detail on the use-case?  If these are two people that work for the same company (Account) and are sharing a cart then you would want to ensure you have set up your Channel as B2B or B2X and use Accounts as Olaf has suggested.  

However, if this is a customer service agent or sales agent that's helping a consumer (B2C or B2B) then you would want to look into setting up a Sales Network.  There is some documentation here:  https://learn.liferay.com/commerce/latest/en/users-and-accounts/account-management/using-organizations-to-create-a-sales-network.html that might help you.  You will need to create Organizations to model the "seller" and Accounts to model the "buyer" and define a Sales Agent role as desribed here;  https://learn.liferay.com/commerce/latest/en/users-and-accounts/roles-and-permissions/commerce-roles-reference.html?highlight=sales%20agent#sales-agent. 

Olaf Kock, modified 3 Years ago. New Member Posts: 2 Join Date: 6/8/22 Recent Posts

Hello 
I appreciated your response. 

I have a use case where one cart belongs to a single user.

Regarding your suggestion for sharing a cart within multiple account. Could you please suggest how can we acheive that functionality?
 

Jamie Sammons, modified 3 Years ago. New Member Post: 1 Join Date: 7/21/22 Recent Posts

i'm trying to post.. and it isnt getting posted.. is there a glitch in the forum?