extending model (site genesis) #463
Replies: 6 comments
-
Hi @micheleezza , |
Beta Was this translation helpful? Give feedback.
-
Thanks Ivan |
Beta Was this translation helpful? Give feedback.
-
You can, since regardless of is it SFRA or SiteGenesis - the version of common JS is the same on SFCC Digital. |
Beta Was this translation helpful? Give feedback.
-
superModule is part of the API so it works with SG too. Howeve customers on SiteGenesis often change the code, I would also write a summary what you overload does and how to integrate it if OrderModel was changed or moved |
Beta Was this translation helpful? Give feedback.
-
Ok I've understood. exports.getModel = function (modelName) { calls only models that are in the same directory. So how can I let SF use my model extension? Do I have to extend also app module too? |
Beta Was this translation helpful? Give feedback.
-
You can make a copy the original app.js into your extension cartridge and slightly modify it, use "*/..." instead of "./..." (according to common JS). And yes, SiteGenesis architecture is not that flexible as SFRA in regards of customization. |
Beta Was this translation helpful? Give feedback.
-
Hi guys, I'm new to Salesforce CC developing.
At the moment I'm developing a link cartridge for SFCC using sitegenesis technology.
I've to add a custom action after the "order.placeOrder" method in the OrderModel.js model.
What is the best method to extend a model in the storefront_controllers cartridge?
I saw that the app class calls only model in its directory so do I have to move the app class into my cartridge too? It sounds not good to me.
thanks to all
Michele
Beta Was this translation helpful? Give feedback.
All reactions