Modificado el ficheroClasses/PaymentModule.php justo debajo de:
if (Validate::isEmail($this->context->customer->email)) { Mail::Send( (int)$order->id_lang, 'order_conf', Context::getContext()->getTranslator()->trans( 'Order confirmation', array(), 'Emails.Subject', $orderLanguage->locale ), $data, $this->context->customer->email, $this->context->customer->firstname.' '.$this->context->customer->lastname, null, null, $file_attachement, null, _PS_MAIL_DIR_, false, (int)$order->id_shop ); } "
linea 907
$referenciaCustomer=$this->context->customer->company; $codigo=explode("*", $referenciaCustomer); $referenciaCustomer="R*".$codigo[1]; //extraemos de la dirección el número de el proovedor limpio $consulta_getEmail = Db::getInstance()->executeS(' SELECT email FROM '._DB_PREFIX_.'customer WHERE company="'.$referenciaCustomer.'" '); //buscamos en customer el email de dicho proveedor //log que sirve para detectar errores o mostrar variables /* $logger = new FileLogger(0); //0 == debug level, logDebug() won’t work without this. $logger->setFilename(_PS_ROOT_DIR_."/log/debug.log"); $logger->logDebug("Referencia que recoje".$referenciaCustomer); $logger->logDebug('SELECT email FROM '._DB_PREFIX_.'customer WHERE company="'.$referenciaCustomer.'" '); $logger->logDebug('el email seleccionado es el.'.$consulta_getEmail[0]['email']); */ //si encontramos el email envia el correo al proveedor si no encuentra el email se lo salta if ($consulta_getEmail[0]['email']!="") { $mail_id_lang = $id_lang; $mail_iso = $iso; $to=$consulta_getEmail[0]['email']; /* Mail::Send( (int)(Configuration::get('PS_LANG_DEFAULT')), 'new_order', sprintf(Mail::l('Nuevo pedido desde Pedro miralles : #%d - %s', $mail_id_lang), $order->id, $order->reference), $template_vars, $to, null, null, null, null, null, $this->local_path . 'mails/' );*/ Mail::Send( (int)$order->id_lang, 'order_conf', Context::getContext()->getTranslator()->trans( 'Order confirmation', array(), 'Emails.Subject', $orderLanguage->locale ), $data, $to, null, null, null, $file_attachement, null, _PS_MAIL_DIR_, false, (int)$order->id_shop ); }