How to Create Coupon (Discount) code Programmatically Magento 2?

Create Coupon Programmatically in Magento 2 is the process of first create a Sales rule with basic details, next get rule id and apply rule id to the generate the new coupon.

Create Sales Rule using Magento\SalesRule\Api\Data\RuleInterfaceFactory and Coupon using Magento\SalesRule\Api\Data\CouponInterface. Continue reading “How to Create Coupon (Discount) code Programmatically Magento 2?”

How to remove Customer navigation links from Magento 2?

You can Remove Customer Navigation links from the Customer Dashboard Left sidebar in Magento Opensource and Magento Commerce.

You can remove any navigation links using <referenceBlock name=”LINK_BLCOK_NAME_TO_REMOVE” remove=”true”> node in customer_account.xml file.

I will share all the available Customer Navigation links in Magento Opensource and Commerce site. You can remove specific navigation links using the XML code snippet, Just replace the name with you want to remove from Customer Navigation Left sidebar link name in the XML file,

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="customer-account-navigation-product-reviews-link" remove="true"/>
    </body>
</page>

Path: app/design/frontend/{VendorName}/{themename}/Magento_Theme/view/frontend/layout/customer_account.xml


Opensource Navigation links:

My Account
<referenceBlock name=”customer-account-navigation-account-link” remove=”true”/>

Address Book
<referenceBlock name=”customer-account-navigation-address-link” remove=”true”/>

Account Information
<referenceBlock name=”customer-account-navigation-account-edit-link” remove=”true”/>

My Downloadable Products
<referenceBlock name=”customer-account-navigation-downloadable-products-link” remove=”true”/>

My Invitations
<referenceBlock name=”customer-account-navigation-magento-invitation-link” remove=”true”/>

Newsletter Subscriptions
<referenceBlock name=”customer-account-navigation-newsletter-subscriptions-link” remove=”true”/>

Billing Agreements
<referenceBlock name=”customer-account-navigation-billing-agreements-link” remove=”true”/>

My Product Reviews
<referenceBlock name=”customer-account-navigation-product-reviews-link” remove=”true”/>

My Orders
<referenceBlock name=”customer-account-navigation-orders-link” remove=”true”/>

Stored Payment Methods
<referenceBlock name=”customer-account-navigation-my-credit-cards-link” remove=”true”/>

My Wish List
<referenceBlock name=”customer-account-navigation-wish-list-link” remove=”true”/>


Magento Commerce Navigation Links:

Order by SKU
<referenceBlock name=”customer-account-navigation-checkout-sku-link” remove=”true”/>

Store Credit
<referenceBlock name=”customer-account-navigation-customer-balance-link” remove=”true”/>

Gift Card
<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”/>

My Returns
<referenceBlock name=”customer-account-navigation-return-history-link
” remove=”true”/>

How to remove Product Reviews Customer navigation tab Magento 2?

My Product Reviews Tab displays all the Product reviews given by the customer on the site.

My Product Reviews tab is available in the left sidebar of the Customer Dashboard, Link will be used to display all the reviews of the products given by the customer. If you don’t want to keep Reviews tab, You can disable it using create customer_account.xml file in your theme or module level. Continue reading “How to remove Product Reviews Customer navigation tab Magento 2?”