Simple question and probably already asked but, I don't get how this knockoutJs works and I can't find any clear explanations.
I'm under vendor/magento/module-checkout/view/frontend/web/template/shipping-address/shipping-method-list.html
<tbody>
<!-- ko foreach: { data: rates(), as: 'method'} -->
<!--ko template: { name: element.shippingMethodItemTemplate} --><!-- /ko -->
<!-- /ko -->
</tbody>
I would like to know where is located the method called with rates()
. What is the way to find it ?
Thanks !
Best Answer
Open: vendor/magento/module-checkout/view/frontend/web/template/shipping.html
Check the following line:
Now open JS component: vendor/magento/module-checkout/view/frontend/web/js/view/shipping.js
You can see the template declaration like:
And method: