1

I am using Marketplace extension. If any user is registered as seller in the website then there two order history links are showing in customer dashboard (Seller dashboard or My account section).

One Order History for seller and another for normal customer. Seller can not purchase any items in the website from seller account so I want to remove default Order History links for Seller only.

I want to remove default order history links from seller accounts. Check Screenshot

I am using Magento 2.3.4

2
  • did it worked for you? Jun 11, 2020 at 8:11
  • @AfreenSheikh, I will check and update you. Thanks for your response. Jun 11, 2020 at 12:12

1 Answer 1

0

You can achieve this by adding your own content

  1. remove the order link of sales module and Add your own content with your custom class.

    <referenceBlock name="customer_account_navigation">
        <referenceBlock name="customer-account-navigation-orders-link" remove="true"/>
        <block class="Vendor\Module\Block\Customer\MyOrderLink" name="custom-customer-account-navigation-orders-link">
           <arguments>
               <argument name="path" xsi:type="string">sales/order/history</argument>
                <argument name="label" xsi:type="string" translate="true">My Orders</argument>
                <argument name="sortOrder" xsi:type="number">230</argument>
                </arguments>
        </block>
    </referenceBlock>
    
  2. create class and add condition in your class as per requirement

    namespace Vendor\Module\Block\Customer;
    
    use Magento\Framework\View\Element\Html\Link\Current;
    
    class MyOrderLink extends Current
    {
    
       public function toHtml()
       {
           //add your check or condition here
           $isNotVendor = 0;
    
           //if not vendor then link should appear
           if($isNotVendor){
               return parent::toHtml();
           }
           //if is vendor then link should not appear
           return '';
       }
    }
    

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.