2011-09-09 15:49
Napotkałem kiedyś na post w którym był poruszony temat adresu e-mail zamawiającego z jakim przychodzi zamówienie. Adresatem zamówienia otrzymanego ze strony jesteśmy my sami, dzięki tej przeróbce podanej w poście adresatem zamówienia był zamawiający. Niestety rozwiązanie nie pomaga w wersji 4.x. Problem tkwi w tym, że my otrzymujemy e-mail z prawidłowym nadawcą, a zamawiający otrzymuje e-mail z potwierdzeniem sam od siebie czyli jest nadawcą e-mail ze strony, a powinien w adresacie widnieć nasz adres. Kod w pliku order.php zmieniłem z: sendEmail( $aSend, null, $aData['sEmail'] ); na: $aSend['sSender']= $aData['sEmail']; sendEmail( $aSend, null, $GLOBALS['config']['orders_email'] ); $this->sendEmailToCustomerWithOrderDetails( $sFile, $iOrder ); Ma ktoś jakiś pomysł gdzie tkwi błąd. Niestety nie jestem biegły w kodowaniu dlatego proszę o pomoc. Pozdrawiam.
» Quick.Cart v4.x pakot 2011-09-12 15:52
Solucja do oryginalnej wersji. Edytuj plik core/orders.php funkcja sendEmailWithOrderDetails() zmień linię:
$aSend [ 'sSender' ] = $GLOBALS [ 'config' ][ 'orders_email' ];
na:
if( $bSendToCustomer === true ) $aSend [ 'sSender' ] = $GLOBALS [ 'config' ][ 'orders_email' ]; else $aSend [ 'sSender' ] = $aData [ 'sEmail' ];
I helped? Like it: www.facebook.com/makwebpl 2011-09-16 13:00
>Makaron Zrobiłem jak napisałeś, wszystko na oryginalnej czwórce i niestety wraz nie działa.
< /** * Send email to admin with order details * @return void * @param string $sFile * @param int $iOrder * @param bool $bSendToCustomer */ public function sendEmailWithOrderDetails ( $sFile , $iOrder , $bSendToCustomer = null ){ $oTpl = TplParser :: getInstance ( ); $content = null ; $aData = $this -> throwOrder ( $iOrder ); $aData [ 'sProducts' ] = $this -> listProducts ( $sFile , $iOrder , 'ORDER_EMAIL_' ); $aData [ 'sOrderSummary' ] = $this -> aOrders [ $iOrder ][ 'sOrderSummary' ]; $oTpl -> setVariables ( 'aData' , $aData ); $aSend [ 'sMailContent' ] = preg_replace ( '/\|n\|/' , "\n" , $oTpl -> tbHtml ( $sFile , 'ORDER_EMAIL_BODY' ) ); $aSend [ 'sTopic' ] = $oTpl -> tbHtml ( $sFile , 'ORDER_EMAIL_TITLE' ); if( $bSendToCustomer === true ) $aSend [ 'sSender' ] = $GLOBALS [ 'config' ][ 'orders_email' ]; else $aSend [ 'sSender' ] = $aData [ 'sEmail' ]; sendEmail ( $aSend , null , $GLOBALS [ 'config' ][ 'orders_email' ] ); if( $bSendToCustomer === true ) sendEmail ( $aSend , null , $aData [ 'sEmail' ] ); } // end function sendEmailWithOrderDetails>
2011-09-19 15:45
A co znaczy nie działa, tzn. jak skrypt się zachowuje?
I helped? Like it: www.facebook.com/makwebpl 2011-10-03 15:03
Jest bez zmian: e-mail z zamówieniem wysyłany do mnie jest adresowany moim adresem, a nie klienta. e-mail z zamówieniem wysyłany do klienta jest ok.
www.czech.lublin.pl 2011-10-03 16:29
Hm.. no faktycznie coś namieszałem.. Spróbuj tak:
/** * Send email to admin with order details * @return void * @param string $sFile * @param int $iOrder * @param bool $bSendToCustomer */ public function sendEmailWithOrderDetails ( $sFile , $iOrder , $bSendToCustomer = null ){ $oTpl = TplParser :: getInstance ( ); $content = null ; $aData = $this -> throwOrder ( $iOrder ); $aData [ 'sProducts' ] = $this -> listProducts ( $sFile , $iOrder , 'ORDER_EMAIL_' ); $aData [ 'sOrderSummary' ] = $this -> aOrders [ $iOrder ][ 'sOrderSummary' ]; $oTpl -> setVariables ( 'aData' , $aData ); $aSend [ 'sMailContent' ] = preg_replace ( '/\|n\|/' , "\n" , $oTpl -> tbHtml ( $sFile , 'ORDER_EMAIL_BODY' ) ); $aSend [ 'sTopic' ] = $oTpl -> tbHtml ( $sFile , 'ORDER_EMAIL_TITLE' ); $aSend [ 'sSender' ] = $aData [ 'sEmail' ]; sendEmail ( $aSend , null , $GLOBALS [ 'config' ][ 'orders_email' ] ); if( $bSendToCustomer === true ){ $aSend [ 'sSender' ] = $GLOBALS [ 'config' ][ 'orders_email' ]; sendEmail ( $aSend , null , $aData [ 'sEmail' ] ); } } // end function sendEmailWithOrderDetails
I helped? Like it: www.facebook.com/makwebpl 2011-10-04 09:51
Sprawdzone, działa w 100% . Dziękuję za pomoc.
www.czech.lublin.pl