Magento 2.4.2: How to disable inventory_in_store_pickup_sales_send_order_notified_emails?

magento.stackexchange https://magento.stackexchange.com/questions/335501

  •  16-04-2021
  •  | 
  •  

Question

As I work to improve my site's performance, I would like to disable inventory_in_store_pickup_sales_send_order_notified_emails. Please let me know how to disable it?

Was it helpful?

Solution

Create your own module and add the following:

Module/Vendor/etc/crontab.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">
    <group id="default">
        <job name="inventory_in_store_pickup_sales_send_order_notified_emails" instance="Magento\InventoryInStorePickupSales\Model\NotifyOrdersAreReadyForPickupEmailSender" method="execute">
            <schedule>* * 31 2 *</schedule>
        </job>
    </group>
</config>

You are basically tricking Magento into registering a valid cronjob, but the schedule is an unexisting date (hence the 31st of February there:) )

Also, make sure to add the dependency of the original module, like this:

Module/Vendor/etc/module.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Module_Vendor">
        <sequence>
            <module name="Magento_InventoryInStorePickupSales"/>
        </sequence>
    </module>
</config>
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top