Question

I wanted to create a custom checkbox in checkout view. I did it by adding the following code

<item name="showMore" xsi:type="array">
  <item name="component" xsi:type="string">Magento_Checkout/js/view/more</item>
  <item name="config" xsi:type="array">
    <item name="template" xsi:type="string">Magento_Checkout/more</item>
  </item>
</item>

The problem is that magento is looking for template file under pub/static/frontend/themeName/en_GB/Magento_Checkout/template/more.html and it is not there.

I tried to generate it by:

  • php bin/magento setup:upgrade
  • php bin/magento setup:static-content:deploy
  • flushing magento cache
  • changing between dev and prod mode

but without any success. Am i missing something?

PS. Checkbox works good when i manually copy template file to pub/static, but this is probably not a solution right?..

Was it helpful?

Solution

Magento will check the file in Magento_Checkout/template/more.html as by default the files should be stored in template folder.

so create your more.html file under Magento_Checkout/view/frontend/web/template/more.html it will work

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top