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!
Asked
Active
Viewed 180 times
2 Answers
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
tru.d
- 325
- 1
- 2
- 17
-
this is helpful – Amol Bhandari SJ Oct 28 '19 at 09: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 '19 at 00: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(
}
}
Partab Saifuddin Zakir
- 1,238
- 1
- 18
- 43
Waqar Ali
- 2,319
- 16
- 44