Completed
Push — master ( e00620...73f050 )
by
unknown
16s queued 11s
created
WC_Pagantis.php 2 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -33,21 +33,21 @@  discard block
 block discarded – undo
33 33
     const ORDERS_TABLE = 'posts';
34 34
 
35 35
     public $defaultConfigs = array('PAGANTIS_TITLE'=>'Instant Financing',
36
-                                   'PAGANTIS_SIMULATOR_DISPLAY_TYPE'=>'pgSDK.simulator.types.SIMPLE',
37
-                                   'PAGANTIS_SIMULATOR_DISPLAY_SKIN'=>'pgSDK.simulator.skins.BLUE',
38
-                                   'PAGANTIS_SIMULATOR_DISPLAY_POSITION'=>'hookDisplayProductButtons',
39
-                                   'PAGANTIS_SIMULATOR_START_INSTALLMENTS'=>3,
40
-                                   'PAGANTIS_SIMULATOR_MAX_INSTALLMENTS'=>12,
41
-                                   'PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR'=>'default',
42
-                                   'PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'=>'pgSDK.simulator.positions.INNER',
43
-                                   'PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR'=>'a:3:{i:0;s:48:"div.summary *:not(del)>.woocommerce-Price-amount";i:1;s:54:"div.entry-summary *:not(del)>.woocommerce-Price-amount";i:2;s:36:"*:not(del)>.woocommerce-Price-amount";}',
44
-                                   'PAGANTIS_SIMULATOR_CSS_QUANTITY_SELECTOR'=>'a:2:{i:0;s:22:"div.quantity input.qty";i:1;s:18:"div.quantity>input";}',
45
-                                   'PAGANTIS_FORM_DISPLAY_TYPE'=>0,
46
-                                   'PAGANTIS_DISPLAY_MIN_AMOUNT'=>1,
47
-                                   'PAGANTIS_URL_OK'=>'',
48
-                                   'PAGANTIS_URL_KO'=>'',
49
-                                   'PAGANTIS_ALLOWED_COUNTRIES' => 'a:2:{i:0;s:2:"es";i:1;s:2:"it";}',
50
-                                   'PAGANTIS_PROMOTION_EXTRA' => '<p>Finance this product <span class="pmt-no-interest">without interest!</span></p>'
36
+                                    'PAGANTIS_SIMULATOR_DISPLAY_TYPE'=>'pgSDK.simulator.types.SIMPLE',
37
+                                    'PAGANTIS_SIMULATOR_DISPLAY_SKIN'=>'pgSDK.simulator.skins.BLUE',
38
+                                    'PAGANTIS_SIMULATOR_DISPLAY_POSITION'=>'hookDisplayProductButtons',
39
+                                    'PAGANTIS_SIMULATOR_START_INSTALLMENTS'=>3,
40
+                                    'PAGANTIS_SIMULATOR_MAX_INSTALLMENTS'=>12,
41
+                                    'PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR'=>'default',
42
+                                    'PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'=>'pgSDK.simulator.positions.INNER',
43
+                                    'PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR'=>'a:3:{i:0;s:48:"div.summary *:not(del)>.woocommerce-Price-amount";i:1;s:54:"div.entry-summary *:not(del)>.woocommerce-Price-amount";i:2;s:36:"*:not(del)>.woocommerce-Price-amount";}',
44
+                                    'PAGANTIS_SIMULATOR_CSS_QUANTITY_SELECTOR'=>'a:2:{i:0;s:22:"div.quantity input.qty";i:1;s:18:"div.quantity>input";}',
45
+                                    'PAGANTIS_FORM_DISPLAY_TYPE'=>0,
46
+                                    'PAGANTIS_DISPLAY_MIN_AMOUNT'=>1,
47
+                                    'PAGANTIS_URL_OK'=>'',
48
+                                    'PAGANTIS_URL_KO'=>'',
49
+                                    'PAGANTIS_ALLOWED_COUNTRIES' => 'a:2:{i:0;s:2:"es";i:1;s:2:"it";}',
50
+                                    'PAGANTIS_PROMOTION_EXTRA' => '<p>Finance this product <span class="pmt-no-interest">without interest!</span></p>'
51 51
     );
52 52
 
53 53
     /** @var Array $extraConfig */
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
         if ($file == plugin_basename(__FILE__)) {
357 357
             $links[] = '<a href="'.WcPagantis::GIT_HUB_URL.'" target="_blank">'.__('Documentation', 'pagantis').'</a>';
358 358
             $links[] = '<a href="'.WcPagantis::PAGANTIS_DOC_URL.'" target="_blank">'.
359
-                       __('API documentation', 'pagantis').'</a>';
359
+                        __('API documentation', 'pagantis').'</a>';
360 360
             $links[] = '<a href="'.WcPagantis::SUPPORT_EML.'">'.__('Support', 'pagantis').'</a>';
361 361
 
362 362
             return $links;
Please login to merge, or discard this patch.
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -76,8 +76,8 @@  discard block
 block discarded – undo
76 76
         register_activation_hook(__FILE__, array($this, 'pagantisActivation'));
77 77
         add_action('woocommerce_product_options_general_product_data', array($this, 'pagantisPromotedProductTpl'));
78 78
         add_action('woocommerce_process_product_meta', array($this, 'pagantisPromotedVarSave'));
79
-        add_action('woocommerce_product_bulk_edit_start', array($this,'pagantisPromotedBulkTemplate'));
80
-        add_action('woocommerce_product_bulk_edit_save', array($this,'pagantisPromotedBulkTemplateSave'));
79
+        add_action('woocommerce_product_bulk_edit_start', array($this, 'pagantisPromotedBulkTemplate'));
80
+        add_action('woocommerce_product_bulk_edit_save', array($this, 'pagantisPromotedBulkTemplateSave'));
81 81
     }
82 82
 
83 83
     /**
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
     {
104 104
         $post_id = $product->get_id();
105 105
         $pagantis_promoted_value = $_REQUEST['pagantis_promoted'];
106
-        if ($pagantis_promoted_value == 'on') {
106
+        if ($pagantis_promoted_value=='on') {
107 107
             $pagantis_promoted_value = 'yes';
108 108
         } else {
109 109
             $pagantis_promoted_value = 'no';
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
     public function pagantisPromotedVarSave($post_id)
138 138
     {
139 139
         $pagantis_promoted_value = $_POST['pagantis_promoted'];
140
-        if ($pagantis_promoted_value == null) {
140
+        if ($pagantis_promoted_value==null) {
141 141
             $pagantis_promoted_value = 'no';
142 142
         }
143 143
         update_post_meta($post_id, 'custom_product_pagantis_promoted', esc_attr($pagantis_promoted_value));
@@ -150,8 +150,8 @@  discard block
 block discarded – undo
150 150
      */
151 151
     public function loadPagantisTranslation($mofile, $domain)
152 152
     {
153
-        if ('pagantis' === $domain) {
154
-            $mofile = WP_LANG_DIR . '/../plugins/pagantis/languages/pagantis-' . get_locale() . '.mo';
153
+        if ('pagantis'===$domain) {
154
+            $mofile = WP_LANG_DIR.'/../plugins/pagantis/languages/pagantis-'.get_locale().'.mo';
155 155
         }
156 156
         return $mofile;
157 157
     }
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
         global $wpdb;
165 165
 
166 166
         $tableName = $wpdb->prefix.self::CONCURRENCY_TABLE;
167
-        if ($wpdb->get_var("SHOW TABLES LIKE '$tableName'") != $tableName) {
167
+        if ($wpdb->get_var("SHOW TABLES LIKE '$tableName'")!=$tableName) {
168 168
             $charset_collate = $wpdb->get_charset_collate();
169 169
             $sql = "CREATE TABLE $tableName ( order_id int NOT NULL,  
170 170
                     createdAt timestamp DEFAULT CURRENT_TIMESTAMP, UNIQUE KEY id (order_id)) $charset_collate";
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
         $tableName = $wpdb->prefix.self::CONFIG_TABLE;
176 176
 
177 177
         //Check if table exists
178
-        $tableExists = $wpdb->get_var("SHOW TABLES LIKE '$tableName'") != $tableName;
178
+        $tableExists = $wpdb->get_var("SHOW TABLES LIKE '$tableName'")!=$tableName;
179 179
         if ($tableExists) {
180 180
             $charset_collate = $wpdb->get_charset_collate();
181 181
             $sql = "CREATE TABLE IF NOT EXISTS $tableName (
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
             //Updated value field to adapt to new length < v8.0.1
191 191
             $query = "select COLUMN_TYPE FROM information_schema.COLUMNS where TABLE_NAME='$tableName' AND COLUMN_NAME='value'";
192 192
             $results = $wpdb->get_results($query, ARRAY_A);
193
-            if ($results['0']['COLUMN_TYPE'] == 'varchar(100)') {
193
+            if ($results['0']['COLUMN_TYPE']=='varchar(100)') {
194 194
                 $sql = "ALTER TABLE $tableName MODIFY value varchar(1000)";
195 195
                 $wpdb->query($sql);
196 196
             }
@@ -200,9 +200,9 @@  discard block
 block discarded – undo
200 200
                                or config='PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR'";
201 201
             $dbCurrentConfig = $wpdb->get_results($query, ARRAY_A);
202 202
             foreach ($dbCurrentConfig as $item) {
203
-                if ($item['config'] == 'PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR') {
203
+                if ($item['config']=='PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR') {
204 204
                     $css_price_selector = $this->preparePriceSelector($item['value']);
205
-                    if ($item['value'] != $css_price_selector) {
205
+                    if ($item['value']!=$css_price_selector) {
206 206
                         $wpdb->update(
207 207
                             $tableName,
208 208
                             array('value' => stripslashes($css_price_selector)),
@@ -211,9 +211,9 @@  discard block
 block discarded – undo
211 211
                             array('%s')
212 212
                         );
213 213
                     }
214
-                } elseif ($item['config'] == 'PAGANTIS_SIMULATOR_CSS_QUANTITY_SELECTOR') {
214
+                } elseif ($item['config']=='PAGANTIS_SIMULATOR_CSS_QUANTITY_SELECTOR') {
215 215
                     $css_quantity_selector = $this->prepareQuantitySelector($item['value']);
216
-                    if ($item['value'] != $css_quantity_selector) {
216
+                    if ($item['value']!=$css_quantity_selector) {
217 217
                         $wpdb->update(
218 218
                             $tableName,
219 219
                             array('value' => stripslashes($css_quantity_selector)),
@@ -267,9 +267,9 @@  discard block
 block discarded – undo
267 267
         $locale = strtolower(strstr(get_locale(), '_', true));
268 268
         $allowedCountries = unserialize($this->extraConfig['PAGANTIS_ALLOWED_COUNTRIES']);
269 269
         $allowedCountry = (in_array(strtolower($locale), $allowedCountries));
270
-        if ($cfg['enabled'] !== 'yes' || $cfg['pagantis_public_key'] == '' || $cfg['pagantis_private_key'] == '' ||
271
-            $cfg['simulator'] !== 'yes' ||  $product->price < $this->extraConfig['PAGANTIS_DISPLAY_MIN_AMOUNT'] ||
272
-            !$allowedCountry ) {
270
+        if ($cfg['enabled']!=='yes' || $cfg['pagantis_public_key']=='' || $cfg['pagantis_private_key']=='' ||
271
+            $cfg['simulator']!=='yes' || $product->price < $this->extraConfig['PAGANTIS_DISPLAY_MIN_AMOUNT'] ||
272
+            !$allowedCountry) {
273 273
             return;
274 274
         }
275 275
 
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
      */
299 299
     public function addPagantisGateway($methods)
300 300
     {
301
-        if (! class_exists('WC_Payment_Gateway')) {
301
+        if (!class_exists('WC_Payment_Gateway')) {
302 302
             return $methods;
303 303
         }
304 304
 
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
      */
354 354
     public function pagantisRowMeta($links, $file)
355 355
     {
356
-        if ($file == plugin_basename(__FILE__)) {
356
+        if ($file==plugin_basename(__FILE__)) {
357 357
             $links[] = '<a href="'.WcPagantis::GIT_HUB_URL.'" target="_blank">'.__('Documentation', 'pagantis').'</a>';
358 358
             $links[] = '<a href="'.WcPagantis::PAGANTIS_DOC_URL.'" target="_blank">'.
359 359
                        __('API documentation', 'pagantis').'</a>';
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
         $tableName = $wpdb->prefix.self::LOGS_TABLE;
382 382
         $query = "select * from $tableName where createdAt>$from and createdAt<$to order by createdAt desc";
383 383
         $results = $wpdb->get_results($query);
384
-        if (isset($results) && $privateKey == $secretKey) {
384
+        if (isset($results) && $privateKey==$secretKey) {
385 385
             foreach ($results as $key => $result) {
386 386
                 $response[$key]['timestamp'] = $result->createdAt;
387 387
                 $response[$key]['log']       = json_decode($result->log);
@@ -408,12 +408,12 @@  discard block
 block discarded – undo
408 408
 
409 409
         $filters   = ($data->get_params());
410 410
         $secretKey = $filters['secret'];
411
-        $cfg  = get_option('woocommerce_pagantis_settings');
411
+        $cfg = get_option('woocommerce_pagantis_settings');
412 412
         $privateKey = isset($cfg['pagantis_private_key']) ? $cfg['pagantis_private_key'] : null;
413
-        if ($privateKey != $secretKey) {
413
+        if ($privateKey!=$secretKey) {
414 414
             $response['status'] = 401;
415 415
             $response['result'] = 'Unauthorized';
416
-        } elseif ($_SERVER['REQUEST_METHOD'] == 'POST') {
416
+        } elseif ($_SERVER['REQUEST_METHOD']=='POST') {
417 417
             if (count($_POST)) {
418 418
                 foreach ($_POST as $config => $value) {
419 419
                     if (isset($this->defaultConfigs[$config]) && $response['status']==null) {
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
                   and tn.post_date<'".$to->format("Y-m-d")."' order by tn.post_date desc";
474 474
         $results = $wpdb->get_results($query);
475 475
 
476
-        if (isset($results) && $privateKey == $secretKey) {
476
+        if (isset($results) && $privateKey==$secretKey) {
477 477
             foreach ($results as $result) {
478 478
                 $key = $result->ID;
479 479
                 $response['message'][$key]['timestamp'] = $result->post_date;
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
      */
558 558
     private function prepareQuantitySelector($css_quantity_selector)
559 559
     {
560
-        if ($css_quantity_selector == 'default' || $css_quantity_selector == '') {
560
+        if ($css_quantity_selector=='default' || $css_quantity_selector=='') {
561 561
             $css_quantity_selector = $this->defaultConfigs['PAGANTIS_SIMULATOR_CSS_QUANTITY_SELECTOR'];
562 562
         } elseif (!unserialize($css_quantity_selector)) { //in the case of a custom string selector, we keep it
563 563
             $css_quantity_selector = serialize(array($css_quantity_selector));
@@ -573,7 +573,7 @@  discard block
 block discarded – undo
573 573
      */
574 574
     private function preparePriceSelector($css_price_selector)
575 575
     {
576
-        if ($css_price_selector == 'default' || $css_price_selector == '') {
576
+        if ($css_price_selector=='default' || $css_price_selector=='') {
577 577
             $css_price_selector = $this->defaultConfigs['PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR'];
578 578
         } elseif (!unserialize($css_price_selector)) { //in the case of a custom string selector, we keep it
579 579
             $css_price_selector = serialize(array($css_price_selector));
@@ -590,7 +590,7 @@  discard block
 block discarded – undo
590 590
     private function isPromoted($product_id)
591 591
     {
592 592
         $metaProduct = get_post_meta($product_id);
593
-        return ($metaProduct['custom_product_pagantis_promoted']['0'] === 'yes') ? 'true' : 'false';
593
+        return ($metaProduct['custom_product_pagantis_promoted']['0']==='yes') ? 'true' : 'false';
594 594
     }
595 595
 }
596 596
 
Please login to merge, or discard this patch.
controllers/notifyController.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
     private function checkConcurrency()
108 108
     {
109 109
         $this->woocommerceOrderId = $_GET['order-received'];
110
-        if ($this->woocommerceOrderId == '') {
110
+        if ($this->woocommerceOrderId=='') {
111 111
             throw new QuoteNotFoundException();
112 112
         }
113 113
 
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
         $queryResult = $wpdb->get_row("select order_id from $tableName where id='".$this->woocommerceOrderId."'");
140 140
         $this->pagantisOrderId = $queryResult->order_id;
141 141
 
142
-        if ($this->pagantisOrderId == '') {
142
+        if ($this->pagantisOrderId=='') {
143 143
             throw new NoIdentificationException();
144 144
         }
145 145
     }
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
                 $status = '-';
174 174
             }
175 175
 
176
-            if ($status === Order::STATUS_CONFIRMED) {
176
+            if ($status===Order::STATUS_CONFIRMED) {
177 177
                 return true;
178 178
             }
179 179
             throw new WrongStatusException($status);
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
         );
195 195
 
196 196
         if (!$this->woocommerceOrder->has_status($isValidStatus)) { // TO CONFIRM
197
-            $logMessage = "WARNING checkMerchantOrderStatus." .
197
+            $logMessage = "WARNING checkMerchantOrderStatus.".
198 198
                           " Merchant order id:".$this->woocommerceOrder->get_id().
199 199
                           " Merchant order status:".$this->woocommerceOrder->get_status().
200 200
                           " Pagantis order id:".$this->pagantisOrder->getStatus().
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
     {
217 217
         $pagantisAmount = $this->pagantisOrder->getShoppingCart()->getTotalAmount();
218 218
         $wcAmount = (string) floor(100 * $this->woocommerceOrder->get_total());
219
-        if ($pagantisAmount != $wcAmount) {
219
+        if ($pagantisAmount!=$wcAmount) {
220 220
             throw new AmountMismatchException($pagantisAmount, $wcAmount);
221 221
         }
222 222
     }
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
             $this->pagantisOrder = $this->orderClient->confirmOrder($this->pagantisOrderId);
241 241
         } catch (\Exception $e) {
242 242
             $this->pagantisOrder = $this->orderClient->getOrder($this->pagantisOrderId);
243
-            if ($this->pagantisOrder->getStatus() !== Order::STATUS_CONFIRMED) {
243
+            if ($this->pagantisOrder->getStatus()!==Order::STATUS_CONFIRMED) {
244 244
                 throw new UnknownException($e->getMessage());
245 245
             } else {
246 246
                 $logMessage = 'Concurrency issue: Order_id '.$this->pagantisOrderId.' was confirmed by other process';
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
         global $wpdb;
265 265
         $tableName = $wpdb->prefix.self::ORDERS_TABLE;
266 266
 
267
-        if ($wpdb->get_var("SHOW TABLES LIKE '$tableName'") != $tableName) {
267
+        if ($wpdb->get_var("SHOW TABLES LIKE '$tableName'")!=$tableName) {
268 268
             $charset_collate = $wpdb->get_charset_collate();
269 269
             $sql             = "CREATE TABLE $tableName (id int, order_id varchar(50), wc_order_id varchar(50), 
270 270
                   UNIQUE KEY id (id)) $charset_collate";
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
         global $wpdb;
283 283
         $tableName = $wpdb->prefix.self::LOGS_TABLE;
284 284
 
285
-        if ($wpdb->get_var("SHOW TABLES LIKE '$tableName'") != $tableName) {
285
+        if ($wpdb->get_var("SHOW TABLES LIKE '$tableName'")!=$tableName) {
286 286
             $charset_collate = $wpdb->get_charset_collate();
287 287
             $sql = "CREATE TABLE $tableName ( id int NOT NULL AUTO_INCREMENT, log text NOT NULL, 
288 288
                     createdAt timestamp DEFAULT CURRENT_TIMESTAMP, UNIQUE KEY id (id)) $charset_collate";
@@ -339,12 +339,12 @@  discard block
 block discarded – undo
339 339
             $metadataOrder = $this->pagantisOrder->getMetadata();
340 340
             $metadataInfo = null;
341 341
             foreach ($metadataOrder as $metadataKey => $metadataValue) {
342
-                if ($metadataKey == 'promotedProduct') {
343
-                    $metadataInfo.= "/Producto promocionado = $metadataValue";
342
+                if ($metadataKey=='promotedProduct') {
343
+                    $metadataInfo .= "/Producto promocionado = $metadataValue";
344 344
                 }
345 345
             }
346 346
 
347
-            if ($metadataInfo != null) {
347
+            if ($metadataInfo!=null) {
348 348
                 $this->woocommerceOrder->add_order_note($metadataInfo);
349 349
             }
350 350
 
@@ -413,13 +413,13 @@  discard block
 block discarded – undo
413 413
     {
414 414
         global $wpdb;
415 415
         $tableName = $wpdb->prefix.self::CONCURRENCY_TABLE;
416
-        if ($orderId == null) {
416
+        if ($orderId==null) {
417 417
             $query = "DELETE FROM $tableName WHERE createdAt<(NOW()- INTERVAL ".self::CONCURRENCY_TIMEOUT." SECOND)";
418 418
         } else {
419 419
             $query = "DELETE FROM $tableName WHERE order_id = $orderId";
420 420
         }
421 421
         $resultDelete = $wpdb->query($query);
422
-        if ($resultDelete === false) {
422
+        if ($resultDelete===false) {
423 423
             throw new ConcurrencyException();
424 424
         }
425 425
     }
@@ -434,8 +434,8 @@  discard block
 block discarded – undo
434 434
         global $wpdb;
435 435
         $tableName = $wpdb->prefix.self::CONCURRENCY_TABLE;
436 436
         $insertResult = $wpdb->insert($tableName, array('order_id' => $orderId));
437
-        if ($insertResult === false) {
438
-            if ($this->getOrigin() == 'Notify') {
437
+        if ($insertResult===false) {
438
+            if ($this->getOrigin()=='Notify') {
439 439
                 throw new ConcurrencyException();
440 440
             } else {
441 441
                 $query = sprintf(
@@ -446,8 +446,8 @@  discard block
 block discarded – undo
446 446
                 );
447 447
                 $resultSeconds = $wpdb->get_row($query);
448 448
                 $restSeconds = isset($resultSeconds) ? ($resultSeconds->rest) : 0;
449
-                $secondsToExpire = ($restSeconds>self::CONCURRENCY_TIMEOUT) ? self::CONCURRENCY_TIMEOUT : $restSeconds;
450
-                sleep($secondsToExpire+1);
449
+                $secondsToExpire = ($restSeconds > self::CONCURRENCY_TIMEOUT) ? self::CONCURRENCY_TIMEOUT : $restSeconds;
450
+                sleep($secondsToExpire + 1);
451 451
 
452 452
                 $logMessage = sprintf(
453 453
                     "User waiting %s seconds, default seconds %s, bd time to expire %s seconds",
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
     {
473 473
         $this->unblockConcurrency($this->woocommerceOrderId);
474 474
 
475
-        if ($exception == null) {
475
+        if ($exception==null) {
476 476
             $jsonResponse = new JsonSuccessResponse();
477 477
         } else {
478 478
             $jsonResponse = new JsonExceptionResponse();
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
         $jsonResponse->setMerchantOrderId($this->woocommerceOrderId);
483 483
         $jsonResponse->setPagantisOrderId($this->pagantisOrderId);
484 484
 
485
-        if ($_SERVER['REQUEST_METHOD'] == 'POST') {
485
+        if ($_SERVER['REQUEST_METHOD']=='POST') {
486 486
             $jsonResponse->printResponse();
487 487
         } else {
488 488
             return $jsonResponse;
Please login to merge, or discard this patch.
controllers/paymentController.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -277,9 +277,9 @@
 block discarded – undo
277 277
                 if ($promotedProduct == 'true') {
278 278
                     $promotedAmount+=$product->getAmount();
279 279
                     $promotedMessage = 'Promoted Item: ' . $product->getDescription() .
280
-                                       ' Price: ' . $item['line_total'] .
281
-                                       ' Qty: ' . $product->getQuantity() .
282
-                                       ' Item ID: ' . $item['id_product'];
280
+                                        ' Price: ' . $item['line_total'] .
281
+                                        ' Qty: ' . $product->getQuantity() .
282
+                                        ' Item ID: ' . $item['id_product'];
283 283
                     $metadataOrder->addMetadata('promotedProduct', $promotedMessage);
284 284
                 }
285 285
             }
Please login to merge, or discard this patch.
Spacing   +62 added lines, -63 removed lines patch added patch discarded remove patch
@@ -53,37 +53,37 @@  discard block
 block discarded – undo
53 53
         $this->method_title = ucfirst($this->id);
54 54
 
55 55
         //Useful vars
56
-        $this->template_path = plugin_dir_path(__FILE__) . '../templates/';
56
+        $this->template_path = plugin_dir_path(__FILE__).'../templates/';
57 57
         $this->allowed_currencies = array("EUR");
58
-        $this->mainFileLocation = dirname(plugin_dir_path(__FILE__)) . '/WC_Pagantis.php';
58
+        $this->mainFileLocation = dirname(plugin_dir_path(__FILE__)).'/WC_Pagantis.php';
59 59
         $this->plugin_info = get_file_data($this->mainFileLocation, array('Version' => 'Version'), false);
60 60
         $this->language = strstr(get_locale(), '_', true);
61 61
 
62
-        if ($this->language == 'es' || $this->language == '') {
62
+        if ($this->language=='es' || $this->language=='') {
63 63
             $this->icon = esc_url(plugins_url('../assets/images/logopagamastarde.png', __FILE__));
64 64
         } else {
65 65
             $this->icon = esc_url(plugins_url('../assets/images/logo.png', __FILE__));
66 66
         }
67 67
 
68 68
         //Panel form fields
69
-        $this->form_fields = include(plugin_dir_path(__FILE__).'../includes/settings-pagantis.php');//Panel options
69
+        $this->form_fields = include(plugin_dir_path(__FILE__).'../includes/settings-pagantis.php'); //Panel options
70 70
         $this->init_settings();
71 71
 
72 72
         $this->extraConfig = $this->getExtraConfig();
73 73
         $this->title = __($this->extraConfig['PAGANTIS_TITLE'], 'pagantis');
74 74
 
75
-        $this->settings['ok_url'] = ($this->extraConfig['PAGANTIS_URL_OK']!='')?$this->extraConfig['PAGANTIS_URL_OK']:$this->generateOkUrl();
76
-        $this->settings['ko_url'] = ($this->extraConfig['PAGANTIS_URL_KO']!='')?$this->extraConfig['PAGANTIS_URL_KO']:$this->generateKoUrl();
75
+        $this->settings['ok_url'] = ($this->extraConfig['PAGANTIS_URL_OK']!='') ? $this->extraConfig['PAGANTIS_URL_OK'] : $this->generateOkUrl();
76
+        $this->settings['ko_url'] = ($this->extraConfig['PAGANTIS_URL_KO']!='') ? $this->extraConfig['PAGANTIS_URL_KO'] : $this->generateKoUrl();
77 77
         foreach ($this->settings as $setting_key => $setting_value) {
78 78
             $this->$setting_key = $setting_value;
79 79
         }
80 80
 
81 81
         //Hooks
82
-        add_action('woocommerce_update_options_payment_gateways_'.$this->id, array($this,'process_admin_options')); //Save plugin options
83
-        add_action('admin_notices', array($this, 'pagantisCheckFields'));                          //Check config fields
84
-        add_action('woocommerce_receipt_'.$this->id, array($this, 'pagantisReceiptPage'));          //Pagantis form
85
-        add_action('woocommerce_api_wcpagantisgateway', array($this, 'pagantisNotification'));      //Json Notification
86
-        add_filter('woocommerce_payment_complete_order_status', array($this,'pagantisCompleteStatus'), 10, 3);
82
+        add_action('woocommerce_update_options_payment_gateways_'.$this->id, array($this, 'process_admin_options')); //Save plugin options
83
+        add_action('admin_notices', array($this, 'pagantisCheckFields')); //Check config fields
84
+        add_action('woocommerce_receipt_'.$this->id, array($this, 'pagantisReceiptPage')); //Pagantis form
85
+        add_action('woocommerce_api_wcpagantisgateway', array($this, 'pagantisNotification')); //Json Notification
86
+        add_filter('woocommerce_payment_complete_order_status', array($this, 'pagantisCompleteStatus'), 10, 3);
87 87
         add_filter('load_textdomain_mofile', array($this, 'loadPagantisTranslation'), 10, 2);
88 88
     }
89 89
 
@@ -95,8 +95,8 @@  discard block
 block discarded – undo
95 95
      */
96 96
     public function loadPagantisTranslation($mofile, $domain)
97 97
     {
98
-        if ('pagantis' === $domain) {
99
-            $mofile = WP_LANG_DIR . '/../plugins/pagantis/languages/pagantis-' . get_locale() . '.mo';
98
+        if ('pagantis'===$domain) {
99
+            $mofile = WP_LANG_DIR.'/../plugins/pagantis/languages/pagantis-'.get_locale().'.mo';
100 100
         }
101 101
         return $mofile;
102 102
     }
@@ -128,24 +128,24 @@  discard block
 block discarded – undo
128 128
     public function pagantisCheckFields()
129 129
     {
130 130
         $error_string = '';
131
-        if ($this->settings['enabled'] !== 'yes') {
131
+        if ($this->settings['enabled']!=='yes') {
132 132
             return;
133 133
         } elseif (!version_compare(phpversion(), '5.3.0', '>=')) {
134
-            $error_string =  __(' is not compatible with your php and/or curl version', 'pagantis');
134
+            $error_string = __(' is not compatible with your php and/or curl version', 'pagantis');
135 135
             $this->settings['enabled'] = 'no';
136 136
         } elseif ($this->settings['pagantis_public_key']=="" || $this->settings['pagantis_private_key']=="") {
137 137
             $error_string = __(' is not configured correctly, the fields Public Key and Secret Key are mandatory for use this plugin', 'pagantis');
138 138
             $this->settings['enabled'] = 'no';
139 139
         } elseif (!in_array(get_woocommerce_currency(), $this->allowed_currencies)) {
140
-            $error_string =  __(' only can be used in Euros', 'pagantis');
140
+            $error_string = __(' only can be used in Euros', 'pagantis');
141 141
             $this->settings['enabled'] = 'no';
142
-        } elseif ($this->extraConfig['PAGANTIS_SIMULATOR_MAX_INSTALLMENTS']<'2'
143
-                  || $this->extraConfig['PAGANTIS_SIMULATOR_MAX_INSTALLMENTS']>'12') {
142
+        } elseif ($this->extraConfig['PAGANTIS_SIMULATOR_MAX_INSTALLMENTS'] < '2'
143
+                  || $this->extraConfig['PAGANTIS_SIMULATOR_MAX_INSTALLMENTS'] > '12') {
144 144
             $error_string = __(' only can be payed from 2 to 12 installments', 'pagantis');
145
-        } elseif ($this->extraConfig['PAGANTIS_SIMULATOR_START_INSTALLMENTS']<'2'
146
-                  || $this->extraConfig['PAGANTIS_SIMULATOR_START_INSTALLMENTS']>'12') {
145
+        } elseif ($this->extraConfig['PAGANTIS_SIMULATOR_START_INSTALLMENTS'] < '2'
146
+                  || $this->extraConfig['PAGANTIS_SIMULATOR_START_INSTALLMENTS'] > '12') {
147 147
             $error_string = __(' only can be payed from 2 to 12 installments', 'pagantis');
148
-        } elseif ($this->extraConfig['PAGANTIS_DISPLAY_MIN_AMOUNT']<0) {
148
+        } elseif ($this->extraConfig['PAGANTIS_DISPLAY_MIN_AMOUNT'] < 0) {
149 149
             $error_string = __(' can not have a minimum amount less than 0', 'pagantis');
150 150
         }
151 151
 
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 
180 180
             $shippingAddress = $order->get_address('shipping');
181 181
             $billingAddress = $order->get_address('billing');
182
-            if ($shippingAddress['address_1'] == '') {
182
+            if ($shippingAddress['address_1']=='') {
183 183
                 $shippingAddress = $billingAddress;
184 184
             }
185 185
 
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
                 ->setNationalId($national_id)
207 207
                 ->setTaxId($tax_id)
208 208
             ;
209
-            $orderBillingAddress =  new Address();
209
+            $orderBillingAddress = new Address();
210 210
             $orderBillingAddress
211 211
                 ->setZipCode($billingAddress['postcode'])
212 212
                 ->setFullName($billingAddress['first_name']." ".$billingAddress['last_name'])
@@ -274,12 +274,12 @@  discard block
 block discarded – undo
274 274
                 $details->addProduct($product);
275 275
 
276 276
                 $promotedProduct = $this->isPromoted($item['product_id']);
277
-                if ($promotedProduct == 'true') {
278
-                    $promotedAmount+=$product->getAmount();
279
-                    $promotedMessage = 'Promoted Item: ' . $product->getDescription() .
280
-                                       ' Price: ' . $item['line_total'] .
281
-                                       ' Qty: ' . $product->getQuantity() .
282
-                                       ' Item ID: ' . $item['id_product'];
277
+                if ($promotedProduct=='true') {
278
+                    $promotedAmount += $product->getAmount();
279
+                    $promotedMessage = 'Promoted Item: '.$product->getDescription().
280
+                                       ' Price: '.$item['line_total'].
281
+                                       ' Qty: '.$product->getQuantity().
282
+                                       ' Item ID: '.$item['id_product'];
283 283
                     $metadataOrder->addMetadata('promotedProduct', $promotedMessage);
284 284
                 }
285 285
             }
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
                 wc_get_template('iframe.php', $template_fields, '', $this->template_path);
352 352
             }
353 353
         } catch (\Exception $exception) {
354
-            wc_add_notice(__('Payment error ', 'pagantis') . $exception->getMessage(), 'error');
354
+            wc_add_notice(__('Payment error ', 'pagantis').$exception->getMessage(), 'error');
355 355
             $this->insertLog($exception);
356 356
             $checkout_url = get_permalink(wc_get_page_id('checkout'));
357 357
             wp_redirect($checkout_url);
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
     public function pagantisNotification()
366 366
     {
367 367
         try {
368
-            $origin = ($_SERVER['REQUEST_METHOD'] == 'POST') ? 'Notify' : 'Order';
368
+            $origin = ($_SERVER['REQUEST_METHOD']=='POST') ? 'Notify' : 'Order';
369 369
 
370 370
             include_once('notifyController.php');
371 371
             $notify = new WcPagantisNotify();
@@ -404,10 +404,10 @@  discard block
 block discarded – undo
404 404
      */
405 405
     public function pagantisCompleteStatus($status, $order_id, $order)
406 406
     {
407
-        if ($order->get_payment_method() == WcPagantisGateway::METHOD_ID) {
408
-            if ($order->get_status() == 'failed') {
407
+        if ($order->get_payment_method()==WcPagantisGateway::METHOD_ID) {
408
+            if ($order->get_status()=='failed') {
409 409
                 $status = 'processing';
410
-            } elseif ($order->get_status() == 'pending' && $status=='completed') {
410
+            } elseif ($order->get_status()=='pending' && $status=='completed') {
411 411
                 $status = 'processing';
412 412
             }
413 413
         }
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
         $allowedCountries = unserialize($this->extraConfig['PAGANTIS_ALLOWED_COUNTRIES']);
432 432
         $allowedCountry = (in_array(strtolower($locale), $allowedCountries));
433 433
         if ($this->enabled==='yes' && $this->pagantis_public_key!='' && $this->pagantis_private_key!='' &&
434
-            (int)$this->get_order_total()>$this->extraConfig['PAGANTIS_DISPLAY_MIN_AMOUNT'] && $allowedCountry) {
434
+            (int) $this->get_order_total() > $this->extraConfig['PAGANTIS_DISPLAY_MIN_AMOUNT'] && $allowedCountry) {
435 435
             return true;
436 436
         }
437 437
 
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
 
460 460
             $redirectUrl = $order->get_checkout_payment_url(true); //pagantisReceiptPage function
461 461
             if (strpos($redirectUrl, 'order-pay=')===false) {
462
-                $redirectUrl.="&order-pay=".$order_id;
462
+                $redirectUrl .= "&order-pay=".$order_id;
463 463
             }
464 464
 
465 465
             return array(
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
             );
469 469
 
470 470
         } catch (Exception $e) {
471
-            wc_add_notice(__('Payment error ', 'pagantis') . $e->getMessage(), 'error');
471
+            wc_add_notice(__('Payment error ', 'pagantis').$e->getMessage(), 'error');
472 472
             return array();
473 473
         }
474 474
     }
@@ -531,7 +531,7 @@  discard block
 block discarded – undo
531 531
     private function generateUrl($url)
532 532
     {
533 533
         $parsed_url = parse_url($url);
534
-        if ($parsed_url !== false) {
534
+        if ($parsed_url!==false) {
535 535
             $parsed_url['query'] = !isset($parsed_url['query']) ? '' : $parsed_url['query'];
536 536
             parse_str($parsed_url['query'], $arrayParams);
537 537
             foreach ($arrayParams as $keyParam => $valueParam) {
@@ -579,11 +579,10 @@  discard block
 block discarded – undo
579 579
     private function getKeysUrl($order, $url)
580 580
     {
581 581
         $defaultFields = (get_class($order)=='WC_Order') ?
582
-            array('order-received'=>$order->get_id(), 'key'=>$order->get_order_key()) :
583
-            array();
582
+            array('order-received'=>$order->get_id(), 'key'=>$order->get_order_key()) : array();
584 583
 
585 584
         $parsedUrl = parse_url($url);
586
-        if ($parsedUrl !== false) {
585
+        if ($parsedUrl!==false) {
587 586
             //Replace parameters from url
588 587
             $parsedUrl['query'] = $this->getKeysParametersUrl($parsedUrl['query'], $defaultFields);
589 588
 
@@ -628,7 +627,7 @@  discard block
 block discarded – undo
628 627
         foreach ($arrayParams as $keyParam => $valueParam) {
629 628
             preg_match('#\{{.*?}\}#', $valueParam, $match);
630 629
             if (count($match)) {
631
-                $key = str_replace(array('{{','}}'), array('',''), $match[0]);
630
+                $key = str_replace(array('{{', '}}'), array('', ''), $match[0]);
632 631
                 $arrayParams[$keyParam] = $defaultFields[$key];
633 632
             }
634 633
         }
@@ -643,13 +642,13 @@  discard block
 block discarded – undo
643 642
      */
644 643
     private function unparseUrl($parsed_url)
645 644
     {
646
-        $scheme   = isset($parsed_url['scheme']) ? $parsed_url['scheme'] . '://' : '';
645
+        $scheme   = isset($parsed_url['scheme']) ? $parsed_url['scheme'].'://' : '';
647 646
         $host     = isset($parsed_url['host']) ? $parsed_url['host'] : '';
648
-        $port     = isset($parsed_url['port']) ? ':' . $parsed_url['port'] : '';
649
-        $query    = isset($parsed_url['query']) ? '?' . $parsed_url['query'] : '';
650
-        $fragment = isset($parsed_url['fragment']) ? '#' . $parsed_url['fragment'] : '';
647
+        $port     = isset($parsed_url['port']) ? ':'.$parsed_url['port'] : '';
648
+        $query    = isset($parsed_url['query']) ? '?'.$parsed_url['query'] : '';
649
+        $fragment = isset($parsed_url['fragment']) ? '#'.$parsed_url['fragment'] : '';
651 650
         $path     = $parsed_url['path'];
652
-        return $scheme . $host . $port . $path . $query . $fragment;
651
+        return $scheme.$host.$port.$path.$query.$fragment;
653 652
     }
654 653
 
655 654
     /**
@@ -671,20 +670,20 @@  discard block
 block discarded – undo
671 670
             $is_guest = "false";
672 671
             $sign_up = substr($current_user->user_registered, 0, 10);
673 672
             $customer_orders = get_posts(array(
674
-                'numberposts' => - 1,
673
+                'numberposts' => -1,
675 674
                 'meta_key'    => '_customer_user',
676 675
                 'meta_value'  => $current_user->ID,
677
-                'post_type'   => array( 'shop_order' ),
678
-                'post_status' => array( 'wc-completed', 'wc-processing', 'wc-refunded' ),
676
+                'post_type'   => array('shop_order'),
677
+                'post_status' => array('wc-completed', 'wc-processing', 'wc-refunded'),
679 678
             ));
680 679
         } else {
681 680
             $is_guest = "true";
682 681
             $customer_orders = get_posts(array(
683
-                'numberposts' => - 1,
682
+                'numberposts' => -1,
684 683
                 'meta_key'    => '_billing_email',
685 684
                 'meta_value'  => $billingEmail,
686
-                'post_type'   => array( 'shop_order' ),
687
-                'post_status' => array( 'wc-completed', 'wc-processing', 'wc-refunded'),
685
+                'post_type'   => array('shop_order'),
686
+                'post_status' => array('wc-completed', 'wc-processing', 'wc-refunded'),
688 687
             ));
689 688
             foreach ($customer_orders as $customer_order) {
690 689
                 if (trim($sign_up)=='' ||
@@ -713,7 +712,7 @@  discard block
 block discarded – undo
713 712
         //Check if id exists
714 713
         $resultsSelect = $wpdb->get_results("select * from $tableName where id='$orderId'");
715 714
         $countResults = count($resultsSelect);
716
-        if ($countResults == 0) {
715
+        if ($countResults==0) {
717 716
             $wpdb->insert(
718 717
                 $tableName,
719 718
                 array('id' => $orderId, 'order_id' => $pagantisOrderId),
@@ -738,7 +737,7 @@  discard block
 block discarded – undo
738 737
         global $wpdb;
739 738
         $tableName = $wpdb->prefix.self::ORDERS_TABLE;
740 739
 
741
-        if ($wpdb->get_var("SHOW TABLES LIKE '$tableName'") != $tableName) {
740
+        if ($wpdb->get_var("SHOW TABLES LIKE '$tableName'")!=$tableName) {
742 741
             $charset_collate = $wpdb->get_charset_collate();
743 742
             $sql             = "CREATE TABLE $tableName ( id int, order_id varchar(50), wc_order_id varchar(50),  
744 743
                   UNIQUE KEY id (id)) $charset_collate";
@@ -771,9 +770,9 @@  discard block
 block discarded – undo
771 770
      */
772 771
     private function getNationalId($order)
773 772
     {
774
-        foreach ((array)$order->get_meta_data() as $mdObject) {
773
+        foreach ((array) $order->get_meta_data() as $mdObject) {
775 774
             $data = $mdObject->get_data();
776
-            if ($data['key'] == 'vat_number') {
775
+            if ($data['key']=='vat_number') {
777 776
                 return $data['value'];
778 777
             }
779 778
         }
@@ -788,9 +787,9 @@  discard block
 block discarded – undo
788 787
      */
789 788
     private function getTaxId($order)
790 789
     {
791
-        foreach ((array)$order->get_meta_data() as $mdObject) {
790
+        foreach ((array) $order->get_meta_data() as $mdObject) {
792 791
             $data = $mdObject->get_data();
793
-            if ($data['key'] == 'billing_cfpiva') {
792
+            if ($data['key']=='billing_cfpiva') {
794 793
                 return $data['value'];
795 794
             }
796 795
         }
@@ -820,7 +819,7 @@  discard block
 block discarded – undo
820 819
     {
821 820
         global $wpdb;
822 821
         $tableName = $wpdb->prefix.self::LOGS_TABLE;
823
-        if ($wpdb->get_var("SHOW TABLES LIKE '$tableName'") != $tableName) {
822
+        if ($wpdb->get_var("SHOW TABLES LIKE '$tableName'")!=$tableName) {
824 823
             $charset_collate = $wpdb->get_charset_collate();
825 824
             $sql = "CREATE TABLE $tableName ( id int NOT NULL AUTO_INCREMENT, log text NOT NULL, 
826 825
                     createdAt timestamp DEFAULT CURRENT_TIMESTAMP, UNIQUE KEY id (id)) $charset_collate";
@@ -838,7 +837,7 @@  discard block
 block discarded – undo
838 837
     private function isPromoted($product_id)
839 838
     {
840 839
         $metaProduct = get_post_meta($product_id);
841
-        return ($metaProduct['custom_product_pagantis_promoted']['0'] === 'yes') ? 'true' : 'false';
840
+        return ($metaProduct['custom_product_pagantis_promoted']['0']==='yes') ? 'true' : 'false';
842 841
     }
843 842
 
844 843
     /**
@@ -851,8 +850,8 @@  discard block
 block discarded – undo
851 850
         $promotedAmount = 0;
852 851
         foreach ($items as $key => $item) {
853 852
             $promotedProduct = $this->isPromoted($item['product_id']);
854
-            if ($promotedProduct == 'true') {
855
-                $promotedAmount+=$item['line_total'];
853
+            if ($promotedProduct=='true') {
854
+                $promotedAmount += $item['line_total'];
856 855
             }
857 856
         }
858 857
 
Please login to merge, or discard this patch.
templates/product_simulator.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <script>
2 2
     function findPriceSelector()
3 3
     {
4
-        var priceSelectors = <?php echo json_encode($priceSelector);?>;
4
+        var priceSelectors = <?php echo json_encode($priceSelector); ?>;
5 5
         return priceSelectors.find(function(candidateSelector) {
6 6
             var priceDOM = document.querySelector(candidateSelector);
7 7
             return (priceDOM != null );
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 
12 12
     function findQuantitySelector()
13 13
     {
14
-        var quantitySelectors = <?php echo json_encode($quantitySelector);?>;
14
+        var quantitySelectors = <?php echo json_encode($quantitySelector); ?>;
15 15
         return quantitySelectors.find(function(candidateSelector) {
16 16
             var priceDOM = document.querySelector(candidateSelector);
17 17
             return (priceDOM != null );
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
             return finishInterval();
52 52
         }
53 53
 
54
-        var price = '<?php echo $total;?>';
54
+        var price = '<?php echo $total; ?>';
55 55
 
56 56
         var locale = '<?php echo $locale; ?>';
57 57
         if (locale == 'es' || locale == '') {
@@ -60,13 +60,13 @@  discard block
 block discarded – undo
60 60
             var sdk = pgSDK;
61 61
         }
62 62
 
63
-        var positionSelector = '<?php echo $positionSelector;?>';
63
+        var positionSelector = '<?php echo $positionSelector; ?>';
64 64
         if (positionSelector === 'default') {
65 65
             positionSelector = '.pagantisSimulator';
66 66
         }
67 67
 
68 68
         var priceSelector = findPriceSelector();
69
-        var promotedProduct = '<?php echo $promoted;?>';
69
+        var promotedProduct = '<?php echo $promoted; ?>';
70 70
         var quantitySelector = findQuantitySelector();
71 71
 
72 72
         simulator_options = {
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
     }
100 100
 </style>
101 101
 <?php
102
-if ($promoted == 'true') {
102
+if ($promoted=='true') {
103 103
     echo $promotedMessage;
104 104
 }
105 105
 ?>
Please login to merge, or discard this patch.