0

How to Change Up-Sell text in Product Edit from admin(Products -> Catalog-> Edit) in Magento 2.

2

The text "Up-Sell Products" is present inside the file vendor/magento/module-catalog/Ui/DataProvider/Product/Form/Modifier/Related.php line 341. If you open the file you will notice that the text is enclosed with a __('Up-Sell Products') which means its multi-locale ready.

So you can simply use the i18n\en_US.csv file inside your custom theme or a custom module to change the text from "Up-Sell Products" to whatever you want.

Reference file vendor/magento/module-catalog/i18n/en_US.csv line 438.

This way is much simpler and doesn't require any kind of module overwriting.

1

Try below code, You need to override vendor/magento/module-catalog/Ui/DataProvider/Product/Form/Modifier/Related.php

and change Up-sell to any other.

di.xml:

<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">

    <preference for="Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Related" type="Vendor\Module\Ui\DataProvider\Product\Form\Modifier\Related" />
</config>

create Related.php into following file vendor\Module\Ui\DataProvider\Product\Form\Modifier;

Copy and Paste Related.php form vendor/magento/module-catalog/Ui/DataProvider/Product/Form/Modifier/Related.php

And change UP-sell Related text to what ever you want.

Clear Cache, and Check it. let me know if you have any issue.

  • HI while adding up-sells from admin getting error on popup (something went be wrong ), can you please – suresh-vagvala Aug 9 '17 at 7:32
  • @suresh-vagvala you got any logs and you only changed label name not a functionality, check you recently changed functions. – Rajkumar .E Aug 9 '17 at 7:42

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.