3

For upsell products in Magento2, how can edit the text above the upsell products that says: "We found other products you might like!"

I would like it to say "Customers also viewed"

  • We can found this text in: vendor/magento/module-catalog/view/frontend/templates/product/list/items.phtml. However, I think the new text is different meaning from the old one. Is there a specific reason for this change? – Khoa TruongDinh Aug 5 '17 at 3:02
3

With Custom Theme:

Override items.phtml in your theme, Copy items.phtml

From:

vendor/magento/module-catalog/view/frontend/templates/product/list/items.phtml

To

app/design/frontend/Vendor/theme/Magento_Catalog/templates/produc‌t/list/items.phtml

Now change

$title = __('We found other products you might like!');

to

$title = __('Customers also viewed');

Flush cache and try.

With Custom Module:

Create catalog_index_index.xml at app/code/Vendor/Module/view/frontend/layout

<?xml version="1.0"?>
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="product.info.upsell">
            <arguments>
                <argument name="template" xsi:type="string">Vendor_Module::product/list/items.phtml</argument>
            </arguments>
        </referenceBlock>
    </body>
</page>

Copy vendor/magento/module-catalog/view/frontend/templates/product/list/items.phtml to app/code/Vendor/Module/view/frontend/templates/product/list/items.phtml

Now change

$title = __('We found other products you might like!');

to

$title = __('Customers also viewed');

Flush cache and try.

0

Rewrite template vendor\magento\module-catalog\view\frontend\templates\product\list\items.phtml line 80 from

$title = __('We found other products you might like!');

to

$title = __('Customers also viewed');

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.