To do this customization we have two options.
In option one, we can use the event on order success and in the second option we can do it by using the plugin
Here I am sharing you insights that how can we disable it by using the plugin:
You have to create di.xml in your existing extension or create an extension which you can do by adding below code,
1 |
app/code/[Vendor Name]/[Module Name]/etc/frontend/di.xml |
1 2 3 |
<type name="Magento\Sales\Model\Order\Email\Container\OrderIdentity"> <plugin name="optDisableEmail" sortOrder="140" type="[Vendor Name]\[Module Name]\Plugin\Order\Email\OrderEmail"/> </type> |
Then you have to create [Vendor Name]\[Module Name]\Plugin\Order\Email\OrderEmail.php file and add below code,
1 2 3 4 5 6 7 8 9 |
public function afterIsEnabled( \Magento\Sales\Model\Order\Email\Container\OrderIdentity $subject, $result ) { if(Get your configuration setting value here){ //Check you require flag value here $result = false; } return $result; } |
After that just clean the Magento cache and check by placing a demo order.
A confirmation email should work based on a configuration setting.
[crayon-63d6a07c13d51795286014/] Using above fucntion Images can be imported directly from...
Override view block using di.xml and add the below code...
You can check a list of called layout XML for...
Follow the below steps to install and set up PWA...
If you want to remove all leading zero's from order,...
Let our Magento expert connect to discuss your requirement.
We offer Magento
certified developers.
Our Magento clientele
is 500+.
We sign NDA for the
security of your projects.
We’ve performed 100+
Magento migration projects.
Free quotation
on your project.
Three months warranty on
code developed by us.