I want to set cron job for order confirm. Below controller code Confirm.php used for confirm order from my fronted custom module. This will Set order status confirm. This is working fine.

namespace \<vender>\<module>\Controller\Order;

class Confirm extends \<vender>\<module>\Controller\Order
     * Seller Order Confirm page.
     * @return \Magento\Framework\View\Result\Page
    public function execute()
        $order_id = $this->getRequest()->getParam('order_ids');

        $sellerId = $this->_customerSession->getCustomerId();
        try {
            $trackingcoll = $this->_objectManager->create(

                         foreach ($trackingcoll as $tracking) {
                        __('The order has been Confirmed by Seller.')

        }catch (\Magento\Framework\Exception\LocalizedException $e) {
                } catch (\Exception $e) {
                        __('We can\'t send the email order right now.')
         return $this->resultRedirectFactory->create()->setPath(
                    ['_secure' => $this->getRequest()->isSecure()]


Same code used in corn page to check pending order & set order confirm.
My question is as follow.

  1. Can changing status sufficient to make order status confirm or want to do something more?
  2. Is there any performance issues if I run cron for every two hours?
  3. Is there any harm to set auto email sending for order confirm?

Thanks in Advance.

Your Answer

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

Browse other questions tagged or ask your own question.