How to set ProviderId in New Icart?

Vote:
 

Hi Team,

How to set ProviderId in Icart .i am not able to set like below one.

CartHelper.Cart.ProviderId = Constants.FrontendCartProvider; // if this is not set explicitly, placed price does not get updated by workflow

Advance Thanks,

#195503
Jul 26, 2018 19:33
Vote:
 

You can try to cast it to Cart and set it there. 

var implementation = cart as Cart;

if (implementation != null)

{

  implementation.ProviderId = ...;

}

//Save the cart

#195507
Jul 26, 2018 21:40
Vote:
 

Thank you Quan,

I have one doubt.we have using Icart only for all operations. If I cast Icart as cart only set the provider id. But I am saving the Icart only. It will be saved or else.

#195519
Jul 27, 2018 9:17
Vote:
 

in the snippet above, you can call either

_orderRepo.Save(cart);

or 

_orderRepo.Save(implementation);

They both work the same

#195520
Jul 27, 2018 9:22
Vote:
 

Thank you Quan,

It worked for me. I used Icart to save.

But why providerId not available in Icart?

#195521
Jul 27, 2018 10:01
Vote:
 

I don't know, there might be some reasons, or it might be just an oversight. 

#195522
Jul 27, 2018 10:04
Vote:
 

Thanks Quan,

#195523
Jul 27, 2018 10:09
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.