Completed
Push — master ( ff0701...c0646a )
by Marcus
01:56
created
src/Controller/Shop/Shoppingcart.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,6 @@
 block discarded – undo
25 25
 use HaaseIT\HCSF\Helper;
26 26
 use HaaseIT\HCSF\Customer\Helper as CHelper;
27 27
 use HaaseIT\HCSF\Shop\Helper as SHelper;
28
-use HaaseIT\Toolbox\DBTools;
29 28
 
30 29
 class Shoppingcart extends Base
31 30
 {
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 
120 120
         if (HelperConfig::$shop['email_orderconfirmation_embed_itemimages_method'] === 'glide') {
121 121
             $sPathToImage = '/'.HelperConfig::$core['directory_images'].'/'.HelperConfig::$shop['directory_images_items'].'/';
122
-            $sImageroot = PATH_BASEDIR . HelperConfig::$core['directory_glide_master'];
122
+            $sImageroot = PATH_BASEDIR.HelperConfig::$core['directory_glide_master'];
123 123
 
124 124
             if (
125 125
                 is_file($sImageroot.substr($sPathToImage.$aV['img'], strlen(HelperConfig::$core['directory_images']) + 1))
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
                     'cache' => PATH_GLIDECACHE,
131 131
                     'max_image_size' => HelperConfig::$core['glide_max_imagesize'],
132 132
                 ]);
133
-                $glideserver->setBaseUrl('/' . HelperConfig::$core['directory_images'] . '/');
133
+                $glideserver->setBaseUrl('/'.HelperConfig::$core['directory_images'].'/');
134 134
                 $base64Img = $glideserver->getImageAsBase64($sPathToImage.$aV['img'], HelperConfig::$shop['email_orderconfirmation_embed_itemimages_glideparams']);
135 135
                 $TMP = explode(',', $base64Img);
136 136
                 $binImg = base64_decode($TMP[1]);
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
                 .HelperConfig::$shop['directory_images_items_email'].'/';
144 144
             if ($aImgInfo = getimagesize($sPathToImage.$aV['img'])) {
145 145
                 $binImg = file_get_contents($sPathToImage.$aV['img']);
146
-                $base64Img = 'data:' . $aImgInfo['mime'] . ';base64,';
146
+                $base64Img = 'data:'.$aImgInfo['mime'].';base64,';
147 147
                 $base64Img .= base64_encode($binImg);
148 148
             }
149 149
         }
@@ -297,15 +297,15 @@  discard block
 block discarded – undo
297 297
             && in_array('paypal', HelperConfig::$shop['paymentmethods'], true) !== false
298 298
             && HelperConfig::$shop['paypal_interactive']
299 299
         ) {
300
-            $redirectto = '/_misc/paypal.html?id=' . $iInsertID;
300
+            $redirectto = '/_misc/paypal.html?id='.$iInsertID;
301 301
         } elseif (
302 302
             $postpaymentmethod !== null
303 303
             && $postpaymentmethod === 'sofortueberweisung'
304 304
             && in_array('sofortueberweisung', HelperConfig::$shop['paymentmethods'], true) !== false
305 305
         ) {
306
-            $redirectto = '/_misc/sofortueberweisung.html?id=' . $iInsertID;
306
+            $redirectto = '/_misc/sofortueberweisung.html?id='.$iInsertID;
307 307
         } else {
308
-            $redirectto = '/_misc/checkedout.html?id=' . $iInsertID;
308
+            $redirectto = '/_misc/checkedout.html?id='.$iInsertID;
309 309
         }
310 310
         \HaaseIT\HCSF\Helper::redirectToPage($redirectto);
311 311
     }
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
     private function sendCheckoutMails($iInsertID, $sMailbody_us, $sMailbody_they, $aImagesToSend)
320 320
     {
321 321
         if (
322
-            isset(HelperConfig::$shop['email_orderconfirmation_attachment_cancellationform_' .HelperConfig::$lang])
322
+            isset(HelperConfig::$shop['email_orderconfirmation_attachment_cancellationform_'.HelperConfig::$lang])
323 323
             && file_exists(
324 324
                 PATH_DOCROOT.HelperConfig::$core['directory_emailattachments']
325 325
                 .'/'.HelperConfig::$shop['email_orderconfirmation_attachment_cancellationform_'
@@ -328,21 +328,21 @@  discard block
 block discarded – undo
328 328
         ) {
329 329
             $aFilesToSend[] =
330 330
                 PATH_DOCROOT.HelperConfig::$core['directory_emailattachments'].'/'
331
-                .HelperConfig::$shop['email_orderconfirmation_attachment_cancellationform_' .HelperConfig::$lang];
331
+                .HelperConfig::$shop['email_orderconfirmation_attachment_cancellationform_'.HelperConfig::$lang];
332 332
         } else {
333 333
             $aFilesToSend = [];
334 334
         }
335 335
 
336 336
         Helper::mailWrapper(
337 337
             filter_input(INPUT_POST, 'email', FILTER_SANITIZE_EMAIL),
338
-            $this->textcats->T('shoppingcart_mail_subject') . ' ' . $iInsertID,
338
+            $this->textcats->T('shoppingcart_mail_subject').' '.$iInsertID,
339 339
             $sMailbody_they,
340 340
             $aImagesToSend,
341 341
             $aFilesToSend
342 342
         );
343 343
         Helper::mailWrapper(
344 344
             HelperConfig::$core['email_sender'],
345
-            'Bestellung im Webshop Nr: ' . $iInsertID,
345
+            'Bestellung im Webshop Nr: '.$iInsertID,
346 346
             $sMailbody_us,
347 347
             $aImagesToSend
348 348
         );
@@ -353,9 +353,9 @@  discard block
 block discarded – undo
353 353
      */
354 354
     private function writeCheckoutToFile($sMailbody_us)
355 355
     {
356
-        $fp = fopen(PATH_LOGS . 'shoplog_' . date('Y-m-d') . '.html', 'a');
356
+        $fp = fopen(PATH_LOGS.'shoplog_'.date('Y-m-d').'.html', 'a');
357 357
         // Write $somecontent to our opened file.
358
-        fwrite($fp, $sMailbody_us . "\n\n-------------------------------------------------------------------------\n\n");
358
+        fwrite($fp, $sMailbody_us."\n\n-------------------------------------------------------------------------\n\n");
359 359
         fclose($fp);
360 360
     }
361 361
 
@@ -405,9 +405,9 @@  discard block
 block discarded – undo
405 405
             'country' => !empty($postcountry) ?
406 406
             (
407 407
                 isset(
408
-                    HelperConfig::$countries['countries_' .HelperConfig::$lang][$postcountry]
408
+                    HelperConfig::$countries['countries_'.HelperConfig::$lang][$postcountry]
409 409
                 )
410
-                    ? HelperConfig::$countries['countries_' .HelperConfig::$lang][$postcountry]
410
+                    ? HelperConfig::$countries['countries_'.HelperConfig::$lang][$postcountry]
411 411
                     : $postcountry)
412 412
             : '',
413 413
             'remarks' => $this->getPostValue('remarks'),
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
             'paymentmethod' => $this->getPostValue('paymentmethod'),
417 417
             'shippingcost' => empty($_SESSION['shippingcost']) ? false : $_SESSION['shippingcost'],
418 418
             'paypallink' => $postpaymentmethod === 'paypal' ? $serverservername.'/_misc/paypal.html?id='.$iId : '',
419
-            'sofortueberweisunglink' => $postpaymentmethod === 'sofortueberweisung' ?  $serverservername.'/_misc/sofortueberweisung.html?id='.$iId : '',
419
+            'sofortueberweisunglink' => $postpaymentmethod === 'sofortueberweisung' ? $serverservername.'/_misc/sofortueberweisung.html?id='.$iId : '',
420 420
             'SESSION' => !$bCust ? Tools::debug($_SESSION, '$_SESSION', true, true) : '',
421 421
             'POST' => !$bCust ? Tools::debug($_POST, '$_POST', true, true) : '',
422 422
             'orderid' => $iId,
@@ -441,15 +441,15 @@  discard block
 block discarded – undo
441 441
                 ($getmsg === 'updated' && !empty($getcartkey) && !empty($getamount))
442 442
                 || ($getmsg === 'removed' && !empty($getcartkey))
443 443
             ) {
444
-                $return .= $this->textcats->T('shoppingcart_msg_' . $getmsg . '_1') . ' ';
444
+                $return .= $this->textcats->T('shoppingcart_msg_'.$getmsg.'_1').' ';
445 445
                 if (isset(HelperConfig::$shop['custom_order_fields']) && mb_strpos($getcartkey, '|') !== false) {
446 446
                     $mCartkeys = explode('|', $getcartkey);
447 447
                     foreach ($mCartkeys as $sKey => $sValue) {
448 448
                         if ($sKey == 0) {
449
-                            $return .= $sValue . ', ';
449
+                            $return .= $sValue.', ';
450 450
                         } else {
451 451
                             $TMP = explode(':', $sValue);
452
-                            $return .= $this->textcats->T('shoppingcart_item_' . $TMP[0]) . ' ' . $TMP[1] . ', ';
452
+                            $return .= $this->textcats->T('shoppingcart_item_'.$TMP[0]).' '.$TMP[1].', ';
453 453
                             unset($TMP);
454 454
                         }
455 455
                     }
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
                 } else {
458 458
                     $return .= $getcartkey;
459 459
                 }
460
-                $return.= ' ' . $this->textcats->T('shoppingcart_msg_'.$getmsg.'_2');
460
+                $return .= ' '.$this->textcats->T('shoppingcart_msg_'.$getmsg.'_2');
461 461
                 if ($getmsg === 'updated') {
462 462
                     $return .= ' '.$getamount;
463 463
                 }
Please login to merge, or discard this patch.