Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change 'Create an Account' text on header.links?

Would like to change the "Create an Account" text to "Register" with an image label before the text but I can't update the text with the following modification of Magento_Customer/layout/default.xml.

<referenceBlock name="register-link">
    <arguments>
        <argument name="label" xsi:type="string" translate="true">Register</argument>
    </arguments>
</referenceBlock>
<referenceBlock name="my-account-link" display="false" />
    <!--
    <move element="register-link" destination="header.links"/>
    <move element="header" destination="header.links" before="-"/>
    <move element="top.links" destination="customer"/>
    <move element="authorization-link" destination="top.links" after="-"/>
    -->


    <block
        class="Magento\Customer\Block\Account\AuthorizationLink" name="authorization-link"
        template="account/link/authorization.phtml" before="register-link"/>
</referenceBlock>
<block class="Magento\Theme\Block\Html\Header" name="header" as="header">
    <!--
    <arguments>
        <argument name="show_part" xsi:type="string">welcome</argument>
    </arguments>
    -->
</block> 

what's my fault?

like image 680
Kllee Avatar asked Dec 25 '22 04:12

Kllee


1 Answers

<referenceBlock name="register-link">
<arguments>
<argument name="label" xsi:type="string" translate="true">Register</argument></arguments>
</referenceBlock>

place above code in /app/design/frontend/vendor/module/Magento_Theme/layout/default.xml

Flush Magento cache...

like image 73
Kapil Singhathia Avatar answered Feb 05 '23 09:02

Kapil Singhathia