1

Magento 2.2.7

I've placed my version of Wishlist list.phtml in my template directory at

/app/design/frontend/Local/argento-stripes-custom/Magento_Wishlist/template/item/list.phtml

However, this is not being used. Template hints shows its calling the default Magento Block & templates, vis

/httpdocs/vendor/magento/module-wishlist/view/frontend/templates/item/list.phtml 

Magento\Wishlist\Block\Customer\Wishlist\Items

If I use a layout file to declare my my phtml file then I get an error about data not being available;

    <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <referenceBlock name="customer.wishlist" >
        <action method="setTemplate">
            <argument name="template" xsi:type="string">Magento_Wishlist::item/list.phtml</argument>
       </action>
</referenceBlock>
</page>

Do I have to declare my own module to override Magento's Wishlist?

3
  • 1
    you don't need to override layout,if you overriding default magento theme file in your custom theme then it should automatically reflect Apr 11, 2019 at 14:42
  • please do compile, upgrade, deploy and clear cache in this order,may be it will work Apr 11, 2019 at 14:43
  • As per as, my idea your reference name is wrong .it should be customer.wishlist.items instead of ``customer.wishlist` <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <referenceBlock name="customer.wishlist" template="YourTemplatefile" /> </page>
    – Amit Bera
    Apr 11, 2019 at 14:48

1 Answer 1

0

/app/design/frontend/Local/argento-stripes-custom/Magento_Wishlist/template/item/list.phtml

The reason your template is not being used is becasue your path is incorrect, you are specifying template not templates if you change this your overwrite should work fine

3
  • Sometimes it's the simplest oversights! Thanks for your help here.
    – Freshwebs
    Apr 18, 2019 at 9:56
  • @Freshwebs glad your issue is resolved Apr 18, 2019 at 9:57
  • This is one of the minor annoyances re: Magento. We have layout, which can contain multiple files, & templates, which might contain a single file. Shouldn't they all be plural??
    – Freshwebs
    Apr 18, 2019 at 9:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.