Any ways to remain customer about payment pending more than 2 days. If order status pending more than 2 days how to send custom mail.
Hello @Aveeva
Found plugin for your requirements.
https://marketplace.magento.com/idnovate-idnovate-paymentreminder.html
@theMageComp Thanks for your reply, I am looking only open source or coding based solution.
@Aveeva yes you can do this.
You can create a cron for a function which would run after every 2 days.
In that function you can check the order status and send email if the status is pending.
Thanks
@rahul Gupta Okay, i know how to run cron, but how can i get the order pending last 2 days.
@Aveeva you can get the order collection filtered on the pending status and whose created date is 2 days before.
Thanks
@rahul Gupta You mean filter status in sales -> order https://imgur.com/J9NaROB right?
@Aveeva no.
Please check the below code.
public function getOrders()
{
if (!($customerId = $this->_customerSession->getCustomerId())) {
return false;
}
if (!$this->orders) {
$this->orders = $this->getOrderCollectionFactory()->create($customerId)->addFieldToSelect(
'*'
)->addFieldToFilter(
'status',
['in' => $this->_orderConfig->getVisibleOnFrontStatuses()]
)->setOrder(
'created_at',
'desc'
);
}
return $this->orders;
}Thanks
@rahul Gupta Can i get complete code?