How to Get My Cart and Checkout Links in Top Links in Magento 2

blockslayoutmagento2toplinks

i want get link My cart and check out to top.links. any help?

and i tried get language in top.links
<block class="Magento\Store\Block\Switcher" name="store_language" as="store_language" template="switch/languages.phtml"/> in header.panel.
But not success. how do get it?

Many thank.

Best Answer

Go to your custom theme app/desing/frontend/{Vendor}/{theme}/Magento_Theme/layout/default.xml file.

 <referenceContainer name="header.panel">
        <block class="Magento\Framework\View\Element\Html\Links" name="top.links">
             <block class="Magento\Framework\View\Element\Html\Link\Current" name="my-link">
                <arguments>
                    <argument name="label" xsi:type="string" translate="true">My Cart</argument>
                    <argument name="path" xsi:type="string">checkout/cart</argument>
                </arguments>
            </block>
            <block class="Magento\Framework\View\Element\Html\Link\Current" name="my-link1">
                <arguments>
                    <argument name="label" xsi:type="string" translate="true">Checkout</argument>
                    <argument name="path" xsi:type="string">checkout</argument>
                </arguments>
            </block>                   
        </block>
    </referenceContainer>