Component rendering order

Loki Checkout components can update the state of the quote via their component repository and then read quotes values again from their component ViewModel. When AJAX calls are handled by the Loki_Components module, repositories are dealt with first and then blocks are rendered with help of their ViewModels. Because of those flows, normally, it does not matter in which order the components are rendered.

An exception to this story is when the ViewModel loads (and saves!) a default value to the quote. For instance, the block loki-checkout.shipping.methods is able to load a default shipping method which is then saved to the quote (if not already). And this potentially changes the way that other blocks like the sidebar is loaded.

Because of this, the block loki-checkout.shipping.methods is loaded before other blocks by setting a block argument render_order (which defaults to 0):

<block name="loki-checkout.shipping.methods">
	<arguments>
    	<argument name="render_order" xsi:type="number">-1</argument>
   	</arguments>
</block>

In the same way, the block loki-checkout.sidebar.totals is rendered after all other blocks:

<block name="loki-checkout.sidebar.totals">
   	<arguments>
    	<argument name="render_order" xsi:type="number">10</argument>
	</arguments>
</block>

Do not randomly add render_order to any block, this wil quickly becomes a mess. Instead, let us know if issues arise from the rendering order, so we can work together towards a proper fix.

Last modified: February 5, 2026