0

I tried to set a new template for checkout.cart.item.renderers block and i found some issue, beucause I didn't know that i have to overwrite separately each type of product. I will post my solution, because maybe someone will face the same problem.

0

filename :checkout_cart_item_renderers.xml

<?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">
        <body>
            <referenceBlock name="checkout.cart.item.renderers.default">
                <action method="setTemplate">
                    <argument name="template" xsi:type="string">Vendor::cart/item/default.phtml</argument>
                </action>
            </referenceBlock>
            <referenceBlock name="checkout.cart.item.renderers.simple">
                <action method="setTemplate">
                    <argument name="template" xsi:type="string">Vendor::cart/item/default.phtml</argument>
                </action>
            </referenceBlock>
            <referenceBlock name="checkout.cart.item.renderers.virtual">
                <action method="setTemplate">
                    <argument name="template" xsi:type="string">Vendor::cart/item/default.phtml</argument>
                </action>
            </referenceBlock>
            <referenceBlock name="checkout.cart.item.renderers.configurable">
                <action method="setTemplate">
                    <argument name="template" xsi:type="string">Vendor::cart/item/default.phtml</argument>
                </action>
            </referenceBlock>
            <referenceBlock name="checkout.cart.item.renderers.downloadable">
                <action method="setTemplate">
                    <argument name="template" xsi:type="string">Vendor::cart/item/default.phtml</argument>
                </action>
            </referenceBlock>
            <referenceBlock name="checkout.cart.item.renderers.grouped">
                <action method="setTemplate">
                    <argument name="template" xsi:type="string">Vendor::cart/item/default.phtml</argument>
                </action>
            </referenceBlock>
            <referenceBlock name="checkout.cart.item.renderers.bundle">
                <action method="setTemplate">
                    <argument name="template" xsi:type="string">Vendor::cart/item/default.phtml</argument>
                </action>
            </referenceBlock>
        </body>
    </page>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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