Hi How can we reorder the checkout modules in the ...
# suitecommerce
m
Hi How can we reorder the checkout modules in the latest version of SCA?
s
So, generally speaking, we don't offer any mechanisms for this. The closest we have is the ability to add and remove modules, which can include an ordering property. Theoretically, you could remove all modules and then add them back in the order that you want. I think the intention is that the checkout module configurations that we include out of the box are designed to be static. Site owners have the ability to choose which configuration they want to use and so the idea is that we have provided a few out of the box. Developers, therefore, perhaps shouldn't change those. But that isn't a rule. In other words, there really isn't a way to do what you want to do. I think you can either do: 1. Your idea of using JavaScript to pass in an array of a new order of steps (I've not tried this, so I have no idea if it's a good idea) 2. Use addModule and removeModule to add/remove modules to an existing step configuration 3. Create your own step configuration If you're using SCA then simply copying an existing steps configuration file and changing it how you want would work. Option 3 is probably the best out of the three imo.
I would just be sure to do thorough testing as I am not sure how hardcoded some parts of the checkout are. For example, we have references to 'opc' in some checkout modules, which may mean that if you want to replicate how OPC works (except in a custom module) some things may not work and so will need changing. In which case, it may be easier and safer to simply reorder the steps using JavaScript.
m
Thanks for the reply Steve! I did this in the earlier versions where we can simply swap the modules within the OPC file itself. ( Workaround 3 from your notes) I've been trying to do the same now using extensions. As the OPC is not the extended module I could not able to extend it. Not sure how to make it work/run.
e
@MJ Try the checkout component, removing and adding the modules as you need them. Play around with that to get familiar, that is your best bet. I have done that for a few modules (well a single one, it was at the bottom and then I placed top) but I have not tried to reorder the full checkout.
m
Ya I'll try
m
y