Try our conversational search powered by Generative AI!

How to extend commerce class ?

Vote:
 

Hi everyone,

So I am faced with a brick wall regarding the extension of already existing classes ( models) 

in my case I need to have my own field to implement specific logic, I want to have the new added fields in the ICart or the Cart data model that I get when using Load() method of the IOrderRepository 

I looked into meta classes , and tried using Commerce UI to achieve that, and I got lost trying to connect/attach the meta class to my desired class (Cart class) 

 

So I need help with the following :- 

How to create and add new fields to an already existing Class like Cart (ICart) class , programmatically and with UI ? would be massively grateful if the answer was step by step and where to put the code, since with no steps I am just stuck where i was (creating meta class but don't know how to attach it to a specific OrderClass )Comm

#313246
Nov 28, 2023 13:07
Vote:
 

There is no UI to manage the order MetaDataPlus (Cart/Order/Payment Plan) yet, unfortunately.

Also, if you are using serializable cart mode (which you likely are), then it is not actually managed by MetaDataPlus. You can set what you want to the Properties, but not in a strongly typed manner, just

cart["Property1"] = data1;

cart["Property2"] = data2;

#313336
Nov 29, 2023 7:45
* 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.