Completed
Push — master ( b17e40...2d3b60 )
by Marcus
04:02
created
src/Controller/Shop/Shoppingcart.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 
121 121
         if (HelperConfig::$shop['email_orderconfirmation_embed_itemimages_method'] === 'glide') {
122 122
             $sPathToImage = '/'.HelperConfig::$core['directory_images'].'/'.HelperConfig::$shop['directory_images_items'].'/';
123
-            $sImageroot = PATH_BASEDIR . HelperConfig::$core['directory_glide_master'];
123
+            $sImageroot = PATH_BASEDIR.HelperConfig::$core['directory_glide_master'];
124 124
 
125 125
             if (
126 126
                 is_file($sImageroot.substr($sPathToImage.$aV['img'], strlen(HelperConfig::$core['directory_images']) + 1))
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
                     'cache' => PATH_GLIDECACHE,
132 132
                     'max_image_size' => HelperConfig::$core['glide_max_imagesize'],
133 133
                 ]);
134
-                $glideserver->setBaseUrl('/' . HelperConfig::$core['directory_images'] . '/');
134
+                $glideserver->setBaseUrl('/'.HelperConfig::$core['directory_images'].'/');
135 135
                 $base64Img = $glideserver->getImageAsBase64($sPathToImage.$aV['img'], HelperConfig::$shop['email_orderconfirmation_embed_itemimages_glideparams']);
136 136
                 $TMP = explode(',', $base64Img);
137 137
                 $binImg = base64_decode($TMP[1]);
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
                 .HelperConfig::$shop['directory_images_items_email'].'/';
145 145
             if ($aImgInfo = getimagesize($sPathToImage.$aV['img'])) {
146 146
                 $binImg = file_get_contents($sPathToImage.$aV['img']);
147
-                $base64Img = 'data:' . $aImgInfo['mime'] . ';base64,';
147
+                $base64Img = 'data:'.$aImgInfo['mime'].';base64,';
148 148
                 $base64Img .= base64_encode($binImg);
149 149
             }
150 150
         }
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
             $sql = DBTools::buildPSInsertQuery($aDataOrder, 'orders');
218 218
             $hResult = $db->prepare($sql);
219 219
             foreach ($aDataOrder as $sKey => $sValue) {
220
-                $hResult->bindValue(':' . $sKey, $sValue);
220
+                $hResult->bindValue(':'.$sKey, $sValue);
221 221
             }
222 222
             $hResult->execute();
223 223
             $iInsertID = $db->lastInsertId();
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
                 $sql = DBTools::buildPSInsertQuery($aV, 'orders_items');
253 253
                 $hResult = $db->prepare($sql);
254 254
                 foreach ($aV as $sKey => $sValue) {
255
-                    $hResult->bindValue(':' . $sKey, $sValue);
255
+                    $hResult->bindValue(':'.$sKey, $sValue);
256 256
                 }
257 257
                 $hResult->execute();
258 258
             }
@@ -291,15 +291,15 @@  discard block
 block discarded – undo
291 291
             && in_array('paypal', HelperConfig::$shop['paymentmethods'], true) !== false
292 292
             && HelperConfig::$shop['paypal_interactive']
293 293
         ) {
294
-            $redirectto = '/_misc/paypal.html?id=' . $iInsertID;
294
+            $redirectto = '/_misc/paypal.html?id='.$iInsertID;
295 295
         } elseif (
296 296
             $postpaymentmethod !== null
297 297
             && $postpaymentmethod === 'sofortueberweisung'
298 298
             && in_array('sofortueberweisung', HelperConfig::$shop['paymentmethods'], true) !== false
299 299
         ) {
300
-            $redirectto = '/_misc/sofortueberweisung.html?id=' . $iInsertID;
300
+            $redirectto = '/_misc/sofortueberweisung.html?id='.$iInsertID;
301 301
         } else {
302
-            $redirectto = '/_misc/checkedout.html?id=' . $iInsertID;
302
+            $redirectto = '/_misc/checkedout.html?id='.$iInsertID;
303 303
         }
304 304
         \HaaseIT\HCSF\Helper::redirectToPage($redirectto);
305 305
     }
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
     private function sendCheckoutMails($iInsertID, $sMailbody_us, $sMailbody_they, $aImagesToSend)
314 314
     {
315 315
         if (
316
-            isset(HelperConfig::$shop['email_orderconfirmation_attachment_cancellationform_' .HelperConfig::$lang])
316
+            isset(HelperConfig::$shop['email_orderconfirmation_attachment_cancellationform_'.HelperConfig::$lang])
317 317
             && file_exists(
318 318
                 PATH_DOCROOT.HelperConfig::$core['directory_emailattachments']
319 319
                 .'/'.HelperConfig::$shop['email_orderconfirmation_attachment_cancellationform_'
@@ -322,21 +322,21 @@  discard block
 block discarded – undo
322 322
         ) {
323 323
             $aFilesToSend[] =
324 324
                 PATH_DOCROOT.HelperConfig::$core['directory_emailattachments'].'/'
325
-                .HelperConfig::$shop['email_orderconfirmation_attachment_cancellationform_' .HelperConfig::$lang];
325
+                .HelperConfig::$shop['email_orderconfirmation_attachment_cancellationform_'.HelperConfig::$lang];
326 326
         } else {
327 327
             $aFilesToSend = [];
328 328
         }
329 329
 
330 330
         Helper::mailWrapper(
331 331
             filter_input(INPUT_POST, 'email', FILTER_SANITIZE_EMAIL),
332
-            $this->textcats->T('shoppingcart_mail_subject') . ' ' . $iInsertID,
332
+            $this->textcats->T('shoppingcart_mail_subject').' '.$iInsertID,
333 333
             $sMailbody_they,
334 334
             $aImagesToSend,
335 335
             $aFilesToSend
336 336
         );
337 337
         Helper::mailWrapper(
338 338
             HelperConfig::$core['email_sender'],
339
-            'Bestellung im Webshop Nr: ' . $iInsertID,
339
+            'Bestellung im Webshop Nr: '.$iInsertID,
340 340
             $sMailbody_us,
341 341
             $aImagesToSend
342 342
         );
@@ -347,9 +347,9 @@  discard block
 block discarded – undo
347 347
      */
348 348
     private function writeCheckoutToFile($sMailbody_us)
349 349
     {
350
-        $fp = fopen(PATH_LOGS . 'shoplog_' . date('Y-m-d') . '.html', 'a');
350
+        $fp = fopen(PATH_LOGS.'shoplog_'.date('Y-m-d').'.html', 'a');
351 351
         // Write $somecontent to our opened file.
352
-        fwrite($fp, $sMailbody_us . "\n\n-------------------------------------------------------------------------\n\n");
352
+        fwrite($fp, $sMailbody_us."\n\n-------------------------------------------------------------------------\n\n");
353 353
         fclose($fp);
354 354
     }
355 355
 
@@ -393,9 +393,9 @@  discard block
 block discarded – undo
393 393
             'country' => !empty($postcountry) ?
394 394
             (
395 395
                 isset(
396
-                    HelperConfig::$countries['countries_' .HelperConfig::$lang][$postcountry]
396
+                    HelperConfig::$countries['countries_'.HelperConfig::$lang][$postcountry]
397 397
                 )
398
-                    ? HelperConfig::$countries['countries_' .HelperConfig::$lang][$postcountry]
398
+                    ? HelperConfig::$countries['countries_'.HelperConfig::$lang][$postcountry]
399 399
                     : $postcountry)
400 400
             : '',
401 401
             'remarks' => $this->getPostValue('remarks'),
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
             'paymentmethod' => $this->getPostValue('paymentmethod'),
405 405
             'shippingcost' => !isset($_SESSION['shippingcost']) || $_SESSION['shippingcost'] == 0 ? false : $_SESSION['shippingcost'],
406 406
             'paypallink' => $postpaymentmethod === 'paypal' ? $serverservername.'/_misc/paypal.html?id='.$iId : '',
407
-            'sofortueberweisunglink' => $postpaymentmethod === 'sofortueberweisung' ?  $serverservername.'/_misc/sofortueberweisung.html?id='.$iId : '',
407
+            'sofortueberweisunglink' => $postpaymentmethod === 'sofortueberweisung' ? $serverservername.'/_misc/sofortueberweisung.html?id='.$iId : '',
408 408
             'SESSION' => !$bCust ? Tools::debug($_SESSION, '$_SESSION', true, true) : '',
409 409
             'POST' => !$bCust ? Tools::debug($_POST, '$_POST', true, true) : '',
410 410
             'orderid' => $iId,
@@ -435,15 +435,15 @@  discard block
 block discarded – undo
435 435
                 ($getmsg === 'updated' && !empty($getcartkey) && !empty($getamount))
436 436
                 || ($getmsg === 'removed' && !empty($getcartkey))
437 437
             ) {
438
-                $return .= $this->textcats->T('shoppingcart_msg_' . $getmsg . '_1') . ' ';
438
+                $return .= $this->textcats->T('shoppingcart_msg_'.$getmsg.'_1').' ';
439 439
                 if (isset(HelperConfig::$shop['custom_order_fields']) && mb_strpos($getcartkey, '|') !== false) {
440 440
                     $mCartkeys = explode('|', $getcartkey);
441 441
                     foreach ($mCartkeys as $sKey => $sValue) {
442 442
                         if ($sKey == 0) {
443
-                            $return .= $sValue . ', ';
443
+                            $return .= $sValue.', ';
444 444
                         } else {
445 445
                             $TMP = explode(':', $sValue);
446
-                            $return .= $this->textcats->T('shoppingcart_item_' . $TMP[0]) . ' ' . $TMP[1] . ', ';
446
+                            $return .= $this->textcats->T('shoppingcart_item_'.$TMP[0]).' '.$TMP[1].', ';
447 447
                             unset($TMP);
448 448
                         }
449 449
                     }
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
                 } else {
452 452
                     $return .= $getcartkey;
453 453
                 }
454
-                $return.= ' ' . $this->textcats->T('shoppingcart_msg_'.$getmsg.'_2');
454
+                $return .= ' '.$this->textcats->T('shoppingcart_msg_'.$getmsg.'_2');
455 455
                 if ($getmsg === 'updated') {
456 456
                     $return .= ' '.$getamount;
457 457
                 }
Please login to merge, or discard this patch.