Codefehler
Willkommens - Email für Neukunden enthält Platzhalter
ID: 242Status: behobenVersion: 2.4.03Report Date: 3. March 2019Product: Bigware Shop 2.4.02
Reporter
AssigneeFredK
Description

In der Willkommensnachricht, die ein neu registrierten Kunde erhält tauchen jetzt wieder die Platzhalter Variablen wie z.B. <-IF_START COUPON-> obwohl kein Willkommens Coupon hinterlegt ist.

Ein Gedanke zu „Willkommens – Email für Neukunden enthält Platzhalter“

  1. Die Funktion search_from_phrase_to_phrase() übergibt einen NULL Wert an die Funktion easy_preg_replace()

    Korrektur in der main_bigware_10.php

    Zeilen 549 – 574

    alt

    			  }else{
    					if (substr_count($text, '<-IF VOUCHER->') > '0'){
    						for ($i = 0; $i <= substr_count($text, '<-IF VOUCHER->'); $i++) {
    							$array_search = search_from_phrase_to_phrase('', '<-IF VOUCHER->', '', '', '<-IF_END VOUCHER->', $text);
    							$text = easy_preg_replace($array_search[0][0], '', $text);
    						}
    					}
    					elseif (substr_count($text, '&lt;-IF VOUCHER-&gt;') > '0'){
    						for ($i = 0; $i <= substr_count($text, '&lt;-IF VOUCHER-&gt;'); $i++) {
    							$array_search = search_from_phrase_to_phrase('', '&lt;-IF VOUCHER-&gt;', '', '', '&lt;-IF_END VOUCHER-&gt;', $text);
    							$text = easy_preg_replace($array_search[0][0], '', $text);
    						}
    					}
    					if (substr_count($text, '<-IF_START VOUCHER->') > '0'){
    						for ($i = 0; $i <= substr_count($text, '<-IF_START VOUCHER->'); $i++) {
    							$array_search = search_from_phrase_to_phrase('', '<-IF_START VOUCHER->', '', '', '<-IF_END VOUCHER->', $text);
    							$text = easy_preg_replace($array_search[0][0], '', $text);
    						}
    					}
    					elseif (substr_count($text, '&lt;-IF_START VOUCHER-&gt;') > '0'){
    						for ($i = 0; $i <= substr_count($text, '&lt;-IF_START VOUCHER-&gt;'); $i++) {
    							$array_search = search_from_phrase_to_phrase('', '&lt;-IF_START VOUCHER-&gt;', '', '', '&lt;-IF_END VOUCHER-&gt;', $text);
    							$text = easy_preg_replace($array_search[0][0], '', $text);
    						}
    					}
    				}
    

    ersetzen mit

    			  }else{
    //					if (substr_count($text, '<-IF VOUCHER->') > '0'){
    					if (stripos($text, '<-IF VOUCHER->') !== false){
    						for ($i = 0; $i <= substr_count($text, '<-IF VOUCHER->'); $i++) {
                  $start = stripos($text, '<-IF VOUCHER->');
                  $end = stripos($text, '<-IF_END VOUCHER->')+18;
                  $text_1 = substr($text, 0, $start);
                  $text_2 = substr($text, $end);
                  $text = $text_1 . $text_2;
    //							$array_search = search_from_phrase_to_phrase('', '<-IF VOUCHER->', '', '', '<-IF_END VOUCHER->', $text);
    //							$text = easy_preg_replace($array_search[0][0], '', $text);
    						}
    					}
    //					elseif (substr_count($text, '&lt;-IF VOUCHER-&gt;') > '0'){
    					elseif (stripos($text, '&lt;-IF VOUCHER-&gt;') !== false){
    						for ($i = 0; $i <= substr_count($text, '&lt;-IF VOUCHER-&gt;'); $i++) {
                  $start = stripos($text, '&lt;-IF VOUCHER-&gt;');
                  $end = stripos($text, '&lt;-IF_END VOUCHER-&gt;')+24;
                  $text_1 = substr($text, 0, $start);
                  $text_2 = substr($text, $end);
                  $text = $text_1 . $text_2;
    //							$array_search = search_from_phrase_to_phrase('', '&lt;-IF VOUCHER-&gt;', '', '', '&lt;-IF_END VOUCHER-&gt;', $text);
    //							$text = easy_preg_replace($array_search[0][0], '', $text);
    						}
    					}
    //					if (substr_count($text, '<-IF_START VOUCHER->') > '0'){
    					if (stripos($text, '<-IF_START VOUCHER->') !== false){
    						for ($i = 0; $i <= substr_count($text, '<-IF_START VOUCHER->'); $i++) {
                  $start = stripos($text, '<-IF_START VOUCHER->');
                  $end = stripos($text, '<-IF_END VOUCHER->')+18;
                  $text_1 = substr($text, 0, $start);
                  $text_2 = substr($text, $end);
                  $text = $text_1 . $text_2;
    //							$array_search = search_from_phrase_to_phrase('', '<-IF_START VOUCHER->', '', '', '<-IF_END VOUCHER->', $text);
    //							$text = easy_preg_replace($array_search[0][0], '', $text);
    						}
    					}
    //					elseif (substr_count($text, '&lt;-IF_START VOUCHER-&gt;') > '0'){
    					elseif (stripos($text, '&lt;-IF_START VOUCHER-&gt;') !== false){
    						for ($i = 0; $i <= substr_count($text, '&lt;-IF_START VOUCHER-&gt;'); $i++) {
                  $start = stripos($text, '&lt;-IF_START VOUCHER-&gt;');
                  $end = stripos($text, '&lt;-IF_END VOUCHER-&gt;')+24;
                  $text_1 = substr($text, 0, $start);
                  $text_2 = substr($text, $end);
                  $text = $text_1 . $text_2;
    //							$array_search = search_from_phrase_to_phrase('', '&lt;-IF_START VOUCHER-&gt;', '', '', '&lt;-IF_END VOUCHER-&gt;', $text);
    //							$text = easy_preg_replace($array_search[0][0], '', $text);
    						}
    					}
    				}
    

    Auch müssen die Zeilen 593 – 618 ersetzt werden

    alt

    			  }else{
    					if (substr_count($text, '<-IF COUPON->') > '0'){
    						for ($i = 0; $i <= substr_count($text, '<-IF COUPON->'); $i++) {
    							$array_search = search_from_phrase_to_phrase('', '<-IF COUPON->', '', '', '<-IF_END COUPON->', $text);
    							$text = easy_preg_replace($array_search[0][0], '', $text);
    						}
    					}
    					elseif (substr_count($text, '&lt;-IF COUPON-&gt;') > '0'){
    						for ($i = 0; $i <= substr_count($text, '&lt;-IF COUPON-&gt;'); $i++) {
    							$array_search = search_from_phrase_to_phrase('', '&lt;-IF COUPON-&gt;', '', '', '&lt;-IF_END COUPON-&gt;', $text);
    							$text = easy_preg_replace($array_search[0][0], '', $text);
    						}
    					}
    					if (substr_count($text, '<-IF_START COUPON->') > '0'){
    						for ($i = 0; $i <= substr_count($text, '<-IF_START COUPON->'); $i++) {
                                $array_search = search_from_phrase_to_phrase('', '<-IF_START COUPON->', '', '', '<-IF_END COUPON->', $text);
    							$text = easy_preg_replace($array_search[0][0], '', $text);
    						}
    					}
    					elseif (substr_count($text, '&lt;-IF_START COUPON-&gt;') > '0'){
    						for ($i = 0; $i <= substr_count($text, '&lt;-IF_START COUPON-&gt;'); $i++) {
                                $array_search = search_from_phrase_to_phrase('', '&lt;-IF_START COUPON-&gt;', '', '', '&lt;-IF_END COUPON-&gt;', $text);
    							$text = easy_preg_replace($array_search[0][0], '', $text);
    						}
    					}
    				}
    

    neu

    			  }else{
    					if (substr_count($text, '<-IF COUPON->') > '0'){
    						for ($i = 0; $i <= substr_count($text, '<-IF COUPON->'); $i++) {
                  $start = stripos($text, '<-IF COUPON->');
                  $end = stripos($text, '<-IF_END COUPON->')+17;
                  $text_1 = substr($text, 0, $start);
                  $text_2 = substr($text, $end);
                  $text = $text_1 . $text_2;
    //							$array_search = search_from_phrase_to_phrase('', '<-IF COUPON->', '', '', '<-IF_END COUPON->', $text);
    //							$text = easy_preg_replace($array_search[0][0], '', $text);
    						}
    					}
    					elseif (substr_count($text, '&lt;-IF COUPON-&gt;') > '0'){
    						for ($i = 0; $i <= substr_count($text, '&lt;-IF COUPON-&gt;'); $i++) {
                  $start = stripos($text, '&lt;-IF COUPON-&gt;');
                  $end = stripos($text, '&lt;-IF_END COUPON-&gt;')+23;
                  $text_1 = substr($text, 0, $start);
                  $text_2 = substr($text, $end);
                  $text = $text_1 . $text_2;
    //							$array_search = search_from_phrase_to_phrase('', '&lt;-IF COUPON-&gt;', '', '', '&lt;-IF_END COUPON-&gt;', $text);
    //							$text = easy_preg_replace($array_search[0][0], '', $text);
    						}
    					}
    					if (substr_count($text, '<-IF_START COUPON->') > '0'){
    						for ($i = 0; $i <= substr_count($text, '<-IF_START COUPON->'); $i++) {
                  $start = stripos($text, '<-IF_START COUPON->');
                  $end = stripos($text, '<-IF_END COUPON->')+17;
                  $text_1 = substr($text, 0, $start);
                  $text_2 = substr($text, $end);
                  $text = $text_1 . $text_2;
    //              $array_search = search_from_phrase_to_phrase('', '<-IF_START COUPON->', '', '', '<-IF_END COUPON->', $text);
    //							$text = easy_preg_replace($array_search[0][0], '', $text);
    						}
    					}
    					elseif (substr_count($text, '&lt;-IF_START COUPON-&gt;') > '0'){
    						for ($i = 0; $i <= substr_count($text, '&lt;-IF_START COUPON-&gt;'); $i++) {
                  $start = stripos($text, '&lt;-IF_START COUPON-&gt;');
                  $end = stripos($text, '&lt;-IF_END COUPON-&gt;')+23;
                  $text_1 = substr($text, 0, $start);
                  $text_2 = substr($text, $end);
                  $text = $text_1 . $text_2;
    //              $array_search = search_from_phrase_to_phrase('', '&lt;-IF_START COUPON-&gt;', '', '', '&lt;-IF_END COUPON-&gt;', $text);
    //							$text = easy_preg_replace($array_search[0][0], '', $text);
    						}
    					}
    				}
    

Schreibe einen Kommentar