1

I can not find any way to change the text in this block when logging in. enter image description here

does anyone know how I can change this content?

3
  • Please template hints on in the admin panel then you can display where it is this block Commented Jul 19, 2018 at 10:01
  • I fount this block in: app/design/template/template/magento-customer/newcustomer.phtml and I have change text here. But now: just now how do I display the translated this text for 2 store view ? Commented Jul 19, 2018 at 10:03
  • You can translate it by translation Csv for multiple store. No need to change in phtml file. Commented Jul 19, 2018 at 10:05

3 Answers 3

1

You can overwrite this file:

/vendor/magento/module-customer/view/frontend/templates/newcustomer.phtml

1
  • Sanne, in this file I have another text: <p><?= $block->escapeHtml(__('Creating an account has many benefits: check out faster, keep more than one address, track orders and more.')) ?></p> Commented Jul 19, 2018 at 9:57
1

You can fetch the current store id and the store name in block file (using ObjectManager) like below :

 $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $storeManager = $objectManager->get('\Magento\Store\Model\StoreManagerInterface'); $storeID = $storeManager->getStore()->getStoreId(); $storeName = $storeManager->getStore()->getName(); 

you can use this $storeID according to your condition :

 if ($storeID = '1') { // your text }else if ($storeID = '2'){ // Your other text } 
1
  • Poorly-written and completely irrelevant code. Commented Jul 19, 2018 at 10:40
0

Please check below example for multiple store, You can changed text for all store by translation CSV file with out changing any phtml file.

app/design/frontend/Vendor/YourThem/i18n/en_US.csv //First store local code 

"Creating an account has many benefits: check out faster, keep more than one address, track orders and more.","Your custom text for here for Store-1"

app/design/frontend/Vendor/YourThem/i18n/en_GB.csv //Second store local code 

"Creating an account has many benefits: check out faster, keep more than one address, track orders and more.","Your custom text for here for Store-2"

Run below commands and check

php bin/magento setup:upgrade php bin/magento setup:static-content:deploy php bin/magento cache:clean 

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.