The sorting in SCA is governed by a (IMHO quirky) ...
# suitecommerce
p
The sorting in SCA is governed by a (IMHO quirky) session variable, you can potentially customize that and get it to work as you'd prefer. That being said, the order in SCA frontend isn't necesarelly the same as the order on the sales order. So i guess it all depends on what you're looking for... frontend order for the cart or SO order (for printing, myaacount, and what the employees see).
👍 1
w
Thanks for the info, Pablo. I see -- I need these combo item hopefully in parent then child sort order, even as they get created in the back-end. With this statement: "the order in SCA frontend isn't necesarelly the same as the order on the sales order". What do you think of the idea: Add a item options (serial/timestamp), populate this serial/timestamp field as they added to the cart, and then re-sort at the back-end when necessary (before submit)?
s
Yeah, if you just want to manipulate the frontend, this should be relatively straightforward. The lines will be stored as a collection, so you can hook into an event (eg before beforeShowContent), wrap the method that outputs the lines, and just run a sorting algorithm on them
👍 1
w
Steve: I see -- the same as Pablo suggested, well majority wins, I'll take that route then! thanks both for your input!
s
Well, when it comes to SCA, Pablo is like Morpheus from the Matrix.
💪 1
But yeah, it all depends on what you want to achieve. If it's just the presentation of line items on the frontend... just do everything in the frontend code as close to rendering as possible. That way you're not digging too deep into code
If you need the frontend order to match the backend order (ie in the ERP), that is more difficult. And for that you will need to go into the Matrix.
💊 1
😂 1
p
Re-sorting all the lines in before submit might take a performans hit.(although i'm not necesarely sure about this) I'd experiment with that, but also with an after submit and the "async after submit" setting enabled in enable features. Just keep an eye on it.
l
@Lindsey Might we want to do something like this to get around the random re-sorting issue?