Hi everyone, Is there any way to extend the order ...
# suitecommerce
l
Hi everyone, Is there any way to extend the order history from the my account in a suitecommerce? I need to retrieve and change the search of the order history to pull all existing orders and apply some filters.
m
Yes, you can override the SuiteScript OrderHistory.Model and just update it to filter the way you need it to.
👍 1
l
But I assume that for that I need to override the core sca. Is there any way to do it via extension?
m
Yes, you can just extend it as with any other module.
I think the module name is actually
OrderHistory.Model
.
🙌 1
l
Thanks
s
FTR we would strongly recommend not doing this in SuiteCommerce
We recommend that you only use the extensibility layer to make changes to your SuiteCommerce site because the core module you are modifying is managed by us, which means the site could break when we update it.
m
Yup, that’s a definitely a good point. Depending on the use case, there might be an alternative.
You could potentially just filter in the frontend, but surely, the performance won’t be the same.
s
Well, again, modifying the collection of orders on the frontend would not be covered by the extensibility layer, so I would avoid doing that too.
m
And what’s the way to go for cases like this? If you need to filter the collection?
s
It’s not supported in SuiteCommerce. You would switch to SCA and override the module
m
I see. So, in this cases ideally, we should aim for the client to upgrade. Good to know, mate. Thanks!
l
@Steve Goldberg But in case of using SCA.. that means I'd need to edit the source code?
s
Yes. You either override the module or the method – we generally don’t recommend editing files directly
💯 1