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.
If you want get query string params in controller file,...
Create di.xml and add the below code Magemonkey/Redirect/etc/frontend/di.xml [crayon-62847155c3bdb799786128/] Create...
You can try below code to change local date to...
Step 1: First you need to add registration.php file in...
Step1 : Override message.js in current theme file on the...