Интервал между отправкой писем VirtueMart 3

  • 0 Ответов
  • 445 Просмотров

0 Пользователей и 1 Гость просматривают эту тему.

*

Оффлайн dj_lexa

Добрый день!
Если необходимо сделать задержку между отправкой писем покупателю и администратору, то необходимо в файл ../components/com_virtuemart/helpers/shopfunctionsf.php добавить функцию sleep (1);

Было:
if(isset($vars['orderDetails'])){

//If the vRequest is there, the update is done by the order list view BE and so the checkbox does override the defaults.
//$name = 'orders['.$order['details']['BT']->virtuemart_order_id.'][customer_notified]';
//$customer_notified = vRequest::getVar($name,-1);
if(!$useDefault and isset($vars['newOrderData']['customer_notified']) and $vars['newOrderData']['customer_notified']==1 ){
$user = self::sendVmMail( $view, $recipient, $noVendorMail );
vmdebug('renderMail by overwrite');
} else {
$orderstatusForShopperEmail = VmConfig::get('email_os_s',array('U','C','S','R','X'));
if(!is_array($orderstatusForShopperEmail)) $orderstatusForShopperEmail = array($orderstatusForShopperEmail);
if ( in_array((string) $vars['orderDetails']['details']['BT']->order_status,$orderstatusForShopperEmail) ){
$user = self::sendVmMail( $view, $recipient, $noVendorMail );
vmdebug('renderMail by default');
} else{
$user = -1;
}
}
} else {
$user = self::sendVmMail( $view, $recipient, $noVendorMail );
}

if(isset($view->doVendor) && !$noVendorMail) {
if(isset($vars['orderDetails'])){
$order = $vars['orderDetails'];
$orderstatusForVendorEmail = VmConfig::get('email_os_v',array('U','C','R','X'));
if(!is_array($orderstatusForVendorEmail)) $orderstatusForVendorEmail = array($orderstatusForVendorEmail);
if ( in_array((string)$order['details']['BT']->order_status,$orderstatusForVendorEmail)){
self::sendVmMail( $view, $view->vendorEmail, TRUE );
}else{
$user = -1;
}
} else {
self::sendVmMail( $view, $view->vendorEmail, TRUE );
}

}
Стало:
if(isset($vars['orderDetails'])){

//If the vRequest is there, the update is done by the order list view BE and so the checkbox does override the defaults.
//$name = 'orders['.$order['details']['BT']->virtuemart_order_id.'][customer_notified]';
//$customer_notified = vRequest::getVar($name,-1);
if(!$useDefault and isset($vars['newOrderData']['customer_notified']) and $vars['newOrderData']['customer_notified']==1 ){
$user = self::sendVmMail( $view, $recipient, $noVendorMail );
vmdebug('renderMail by overwrite');
} else {
$orderstatusForShopperEmail = VmConfig::get('email_os_s',array('U','C','S','R','X'));
if(!is_array($orderstatusForShopperEmail)) $orderstatusForShopperEmail = array($orderstatusForShopperEmail);
if ( in_array((string) $vars['orderDetails']['details']['BT']->order_status,$orderstatusForShopperEmail) ){
$user = self::sendVmMail( $view, $recipient, $noVendorMail );
vmdebug('renderMail by default');
} else{
$user = -1;
}
}
} else {
$user = self::sendVmMail( $view, $recipient, $noVendorMail );
}

sleep (1);

if(isset($view->doVendor) && !$noVendorMail) {
if(isset($vars['orderDetails'])){
$order = $vars['orderDetails'];
$orderstatusForVendorEmail = VmConfig::get('email_os_v',array('U','C','R','X'));
if(!is_array($orderstatusForVendorEmail)) $orderstatusForVendorEmail = array($orderstatusForVendorEmail);
if ( in_array((string)$order['details']['BT']->order_status,$orderstatusForVendorEmail)){
self::sendVmMail( $view, $view->vendorEmail, TRUE );
}else{
$user = -1;
}
} else {
self::sendVmMail( $view, $view->vendorEmail, TRUE );
}

}
« Последнее редактирование: 24.05.2015, 23:29:02 от dj_lexa »