I use Magento 2.0 for the first time and I am trying to make some changes on Checkout page. For example, I want to change template
module-checkout/view/frontend/web/template/estimation.html
,
so I copied this template to my folder theme to
'Magento_Checkout/web/template/estimation.html'
and I made some changes in it, but nothing changes. Also, for a test, I changed original template but still, no changes.
I use grunt, I deployed the code, cleared all cache. On every other pages, changes do apply, but not on checkout. Do you have any guess, what am I doing wrong?
Also a question – is there any better explanation on how does checkout page on Magento2 work than the one from Magento page?
Best Answer
In your case, the Browser Cache caused your issue, we should disable it when developing and testing.
Chrome Browser
Firefox
I'm not sure my explanation is good enough to understand.
We need to take a look:
vendor/magento/module-checkout/view/frontend/layout/checkout_index_index.xml
. We will see a lot of config nodes. Magento layout for one page checkout comes from here.Navigate to
vendor/magento/module-checkout/view/frontend/templates/onepage.phtml
:The most logic is here.
$block->getJsLayout()
gets the config from the xml layout. The jsMagento_Ui/js/core/app
is in charge of the rendering UI. There are some global javascript variables. These variables are used for other js components.For the js and html templates file, Magento will load them from
pub/static
. They are copied topub/static
after running static content deploy.