Jump to content
Magento é no Mestre Magento
Ariel Cugenotta

Magento 2 - Como Editar os Links Laterais do Minha Conta

Mensagens Recomendadas

Olá pessoal,

Para editar os links do minha conta é simples, basta editar o arquivo abaixo:

app/design/frontend/_YOUR_VENDOR_/_YOUR_THEME_/Magento_Customer/layout/customer_account.xml

Caso esteja usando o LUMA ou o DEFAULT como tema, o arquivo esta nesse local:

vendor/magento/theme-frontend-blank/Magento_Customer/layout/customer_account.xml

Para adicionar, insira o código:

<referenceBlock name="customer_account_navigation">
    <block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-novo-link" after="-" >
         <arguments>
             <argument name="label" xsi:type="string" translate="true">Novo Link Personalizado</argument>
             <argument name="path" xsi:type="string">novo-link</argument>
         </arguments>
    </block>
</referenceBlock>

Para reorganizar os itens use o código:

<move element="LINK_QUE_DESEJA_MOVER" destination="customer_account_navigation" AFTER_OR_BEFORE="NOVA_POSIÇÃO" />
 
<!-- Exemplo: Movendo a Lista de Desejos para baixo do Meus Pedidos -->
<move element="customer-account-navigation-wish-list-link" destination="customer_account_navigation" after="customer-account-navigation-orders-link" />

Para remover um link, use o código abaixo, veja que estou inserindo todos os possíveis links:

<!-- Store credit -->
<referenceBlock name="customer-account-navigation-customer-balance-link" remove="true"/>
 
<!-- Downloadable product link -->
<referenceBlock name="customer-account-navigation-downloadable-products-link" remove="true"/>
 
<!-- Subscription link -->
<referenceBlock name="customer-account-navigation-newsletter-subscriptions-link" remove="true"/>
 
<!-- Billing agreement link -->
<referenceBlock name="customer-account-navigation-billing-agreements-link" remove="true"/>
 
<!-- Product review link -->
<referenceBlock name="customer-account-navigation-product-reviews-link" remove="true"/>
 
<!-- My credit card link -->
<referenceBlock name="customer-account-navigation-my-credit-cards-link" remove="true"/>
 
<!-- Account link -->
<referenceBlock name="customer-account-navigation-account-link" remove="true"/>
 
<!-- Account edit link -->
<referenceBlock name="customer-account-navigation-account-edit-link" remove="true"/>
 
<!-- Address link -->
<referenceBlock name="customer-account-navigation-address-link" remove="true"/>
 
<!-- Orders link -->
<referenceBlock name="customer-account-navigation-orders-link" remove="true"/>
 
<!-- Wish list link -->
<referenceBlock name="customer-account-navigation-wish-list-link" remove="true"/>
 
<!-- Gift card link -->
<referenceBlock name="customer-account-navigation-gift-card-link" remove="true"/>
 
<!-- Gift registry -->
<referenceBlock name="customer-account-navigation-giftregistry-link" remove="true"/>
 
<!-- Reward points -->
<referenceBlock name="customer-account-navigation-reward-link" remove="true"/>
 
<!-- Order by SKU -->
<referenceBlock name="customer-account-navigation-checkout-sku-link" remove="true"/>

Fonte: http://inchoo.net/magento-2/managing-my-account-navigation-links-magento-2/

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Convidado
Responder esse tópico...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Informação Importante

Ao usar este site, você concorda com nossos Termos de Uso (leia).