1

I would like to ask if there is a way to override the design of the custom 3rd party module in magento 2 where I can put my own design and still fetch the data from the database. I'd appreciate any help with regards to this. thanks!

2

You can add your own custom css file and override the module css.Refer below for more guidelines. How to add a custom CSS file in Magento 2

  • this is helpful – Amol Bhandari SJ Oct 28 at 9:35
  • I have tried this but the design does not change. I am using a 3rd party checkout module. IWD Agency. I plan to do my own custom module but my problem now is how to fetch the data to my own design – Miguel Intoy Oct 29 at 0:05
1

if you need any specific function from custom module you can easily get by injecting class of Custom Module in Your Module.

class yourClass extends parentCLass
{
    public function __construct(
        \Vendor\CustomModule\Block\Class $customClass,
        \Magento\Backend\App\Action\Context $context,
    ) {
        $this->customClass   =   $customClass;
        parent::__construct($context);
    }
    public function execute()
    {
       \\use specfic funtio
        $this->customModule->neededFuntion(); 

    }
}

If you want to entrupt a function and do your own task you can use Plugin

In your

vendor\yourModule\etc\frontend\di.xml

<type name="Vendor\CustomModule\Block\Class>
       <plugin name="your_custom_plugin" type="Vendor\YourModule\Plugin\YourPlugin" sortOrder="10"/>
</type>

Now in

Vendor\YourModule\Plugin\YourPlugin

class YourPlugin
{
    public function __construct(
    ) {
    }
    \\ Here you can override any funtion from the custom Module By Follwing hree ways
    public function beforeCuntomFuntion(
    }
    public function aroundCuntomFuntion(
    }
    public function afterCuntomFuntion(
    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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