Passed
Pull Request — master (#4)
by
unknown
02:45
created
catalog/admin/promotion.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -3,12 +3,12 @@  discard block
 block discarded – undo
3 3
 require('includes/application_top.php');
4 4
 
5 5
 define('TABLE_PAGANTIS_CONFIG', 'pagantis_config');
6
-define('TABLE_PRODUCTS_DESCRIPTIONS','products_description');
6
+define('TABLE_PRODUCTS_DESCRIPTIONS', 'products_description');
7 7
 
8 8
 //Check if module is installed
9
-$result = tep_db_query("select * from " . TABLE_CONFIGURATION . " where configuration_key='MODULE_PAYMENT_PAGANTIS_STATUS'");
9
+$result = tep_db_query("select * from ".TABLE_CONFIGURATION." where configuration_key='MODULE_PAYMENT_PAGANTIS_STATUS'");
10 10
 $resultSelect = tep_db_fetch_array($result);
11
-if (tep_db_num_rows($result) == 0 || $resultSelect['configuration_value'] !=='True') {
11
+if (tep_db_num_rows($result) == 0 || $resultSelect['configuration_value'] !== 'True') {
12 12
     tep_redirect('/admin/index.php');
13 13
 }
14 14
 
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
     $resultSelect = tep_db_fetch_array($result);
32 32
     if ($resultSelect['value'] == '') {
33 33
         $promotedProducts = array();
34
-    } else {
34
+    }else {
35 35
         $promotedProducts = array_values((array)unserialize($resultSelect['value']));
36 36
     }
37 37
 }
Please login to merge, or discard this patch.
test/Buy/BuyPromotedProductTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
      */
140 140
     protected function checkPagantisOrderId()
141 141
     {
142
-        $orderId=0;
142
+        $orderId = 0;
143 143
         $notifyUrl = self::OSCURL.self::NOTIFICATION_FOLDER.'?order='.$orderId;
144 144
         $this->assertNotEmpty($notifyUrl, $notifyUrl);
145 145
         $response = Request::post($notifyUrl)->expects('json')->send();
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
         $this->assertEquals(
150 150
             $response->body->merchant_order_id,
151 151
             $orderId,
152
-            $response->body->merchant_order_id.'!='. $orderId
152
+            $response->body->merchant_order_id.'!='.$orderId
153 153
         );
154 154
         $this->assertContains(
155 155
             NoIdentificationException::ERROR_MESSAGE,
Please login to merge, or discard this patch.
catalog/ext/modules/payment/pagantis/notifyController.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -83,22 +83,22 @@  discard block
 block discarded – undo
83 83
             $jsonResponse->setException($exception);
84 84
             $this->insertLog($exception);
85 85
 
86
-            if ($this->extraConfig['PAGANTIS_URL_KO'] =! '') {
86
+            if ($this->extraConfig['PAGANTIS_URL_KO'] = !'') {
87 87
                 $koUrl = $this->extraConfig['PAGANTIS_URL_KO'];
88
-            } else {
88
+            }else {
89 89
                 $koUrl = trim(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL', false));
90 90
             }
91 91
 
92 92
             if ($this->origin == 'notify') {
93 93
                 $jsonResponse->printResponse();
94
-            } else {
94
+            }else {
95 95
                 if ($exception->getMessage() == AlreadyProcessedException::ERROR_MESSAGE) {
96
-                    if ($this->extraConfig['PAGANTIS_URL_OK']!='') {
96
+                    if ($this->extraConfig['PAGANTIS_URL_OK'] != '') {
97 97
                         $confirmationUrl = $this->extraConfig['PAGANTIS_URL_OK'];
98
-                        $confirmationUrl.="?order_id=$this->merchantOrderId";
99
-                    } else {
98
+                        $confirmationUrl .= "?order_id=$this->merchantOrderId";
99
+                    }else {
100 100
                         $confirmationUrl = trim(tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, '', 'SSL', false));
101
-                        $confirmationUrl.="?order_id=$this->merchantOrderId";
101
+                        $confirmationUrl .= "?order_id=$this->merchantOrderId";
102 102
                     }
103 103
 
104 104
                     header("Location: $confirmationUrl");
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 
134 134
         if ($this->origin == 'notify') {
135 135
             $jsonResponse->printResponse();
136
-        } else {
136
+        }else {
137 137
             return $jsonResponse;
138 138
         }
139 139
     }
@@ -206,12 +206,12 @@  discard block
 block discarded – undo
206 206
         try {
207 207
             $this->checkPagantisStatus(array('AUTHORIZED'));
208 208
         } catch (\Exception $e) {
209
-            if ($this->findOscommerceOrderId()!='') {
209
+            if ($this->findOscommerceOrderId() != '') {
210 210
                 throw new AlreadyProcessedException();
211
-            } else {
211
+            }else {
212 212
                 if ($this->pagantisOrder instanceof \Pagantis\OrdersApiClient\Model\Order) {
213 213
                     $status = $this->pagantisOrder->getStatus();
214
-                } else {
214
+                }else {
215 215
                     $status = '-';
216 216
                 }
217 217
                 throw new WrongStatusException($status);
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
     {
227 227
         global $order;
228 228
 
229
-        if ($order->info['order_status']!=='1') {
229
+        if ($order->info['order_status'] !== '1') {
230 230
             throw new AlreadyProcessedException();
231 231
         }
232 232
     }
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
             if ($orderId == null) {
304 304
                 $query = "delete from ".TABLE_PAGANTIS_CONCURRENCY." where  timestamp<".(time() - 5);
305 305
                 tep_db_query($query);
306
-            } elseif ($orderId!='') {
306
+            } elseif ($orderId != '') {
307 307
                 $query = "delete from ".TABLE_PAGANTIS_CONCURRENCY." where id='$orderId'";
308 308
                 tep_db_query($query);
309 309
             }
@@ -355,12 +355,12 @@  discard block
 block discarded – undo
355 355
             if (!$payed) {
356 356
                 if ($this->pagantisOrder instanceof \Pagantis\OrdersApiClient\Model\Order) {
357 357
                     $status = $this->pagantisOrder->getStatus();
358
-                } else {
358
+                }else {
359 359
                     $status = '-';
360 360
                 }
361 361
                 throw new WrongStatusException($status);
362 362
             }
363
-        } else {
363
+        }else {
364 364
             throw new OrderNotFoundException();
365 365
         }
366 366
     }
@@ -397,12 +397,12 @@  discard block
 block discarded – undo
397 397
         $metadataInfo = '';
398 398
         foreach ($metadataOrder as $metadataKey => $metadataValue) {
399 399
             if ($metadataKey == 'promotedProduct') {
400
-                $metadataInfo.= "/Producto promocionado = $metadataValue";
400
+                $metadataInfo .= "/Producto promocionado = $metadataValue";
401 401
             }
402 402
         }
403 403
 
404 404
         $comment = "Pagantis id=$this->pagantisOrderId/Via=".ucfirst($this->origin)."/".$metadataInfo;
405
-        $query = "insert into ".TABLE_ORDERS_STATUS_HISTORY ."(comments, orders_id, orders_status_id, customer_notified, date_added) values
405
+        $query = "insert into ".TABLE_ORDERS_STATUS_HISTORY."(comments, orders_id, orders_status_id, customer_notified, date_added) values
406 406
             ('$comment', ".$insert_id.", '2', -1, now() )";
407 407
         tep_db_query($query);
408 408
 
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
     private function insertLog($exception)
428 428
     {
429 429
         if ($exception instanceof \Exception) {
430
-            $logEntry= new LogEntry();
430
+            $logEntry = new LogEntry();
431 431
             $logEntryJson = $logEntry->error($exception)->toJson();
432 432
 
433 433
             $query = "insert into ".TABLE_PAGANTIS_LOG."(log) values ('$logEntryJson')";
Please login to merge, or discard this patch.
test/configure/ConfigureTest.php 1 patch
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,6 @@
 block discarded – undo
10 10
  * @package Test\Configure
11 11
  *
12 12
  * @group oscommerce-configure
13
-
14 13
  */
15 14
 class ConfigureTest extends AbstractConfigure
16 15
 {
Please login to merge, or discard this patch.
test/configure/ConfigurePPPTest.php 1 patch
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,6 @@
 block discarded – undo
10 10
  * @package Test\Configure
11 11
  *
12 12
  * @group oscommerce-configure-ppp
13
-
14 13
  */
15 14
 class ConfigurePPPTest extends AbstractConfigure
16 15
 {
Please login to merge, or discard this patch.
test/configure/AbstractConfigure.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
      */
18 18
     public function loginToBackOffice()
19 19
     {
20
-        $this->webDriver->get(self::OSCURL . self::BACKOFFICE_FOLDER);
20
+        $this->webDriver->get(self::OSCURL.self::BACKOFFICE_FOLDER);
21 21
         sleep(2);
22 22
 
23 23
         $usernameElementSearch = WebDriverBy::name('username');
Please login to merge, or discard this patch.
catalog/includes/modules/header_tags/ht_pagantis.php 1 patch
Spacing   +99 added lines, -99 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
         ) {
35 35
             $this->enabled = ((MODULE_HEADER_TAGS_PAGANTIS_STATUS == 'True') &&
36 36
                 (MODULE_PAYMENT_PAGANTIS_STATUS == 'True') &&
37
-                (MODULE_PAYMENT_PAGANTIS_SIMULATOR == 'True')) ;
37
+                (MODULE_PAYMENT_PAGANTIS_SIMULATOR == 'True'));
38 38
         }
39 39
 
40 40
         $this->extraConfig = $this->getExtraConfig();
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
      */
67 67
     private function getConfig($config = '')
68 68
     {
69
-        $query       = "select * from ".TABLE_CONFIGURATION . " where configuration_key ='" . $config . "'";
69
+        $query       = "select * from ".TABLE_CONFIGURATION." where configuration_key ='".$config."'";
70 70
         $result      = tep_db_query($query);
71 71
         $resultArray = tep_db_fetch_array($result);
72 72
         return $resultArray['configuration_value'];
@@ -83,29 +83,29 @@  discard block
 block discarded – undo
83 83
         $checkoutPage = strpos($_SERVER[REQUEST_URI], "checkout_payment.php") > 0;
84 84
 
85 85
         //Show promoted html
86
-        if ($this->isPromoted($productId) && $checkoutPage!='1') {
86
+        if ($this->isPromoted($productId) && $checkoutPage != '1') {
87 87
             echo "<div id='promotedText' style='display:none'><br/>".$this->extraConfig['PAGANTIS_PROMOTED_PRODUCT_CODE']."</div>";
88
-            echo '<script>'. PHP_EOL;
89
-            echo '        function loadPromoted()'. PHP_EOL;
90
-            echo '        {'. PHP_EOL;
91
-            echo 'var positionSelector = \'' . $this->extraConfig['PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR']. '\';'. PHP_EOL;
92
-            echo 'if (positionSelector === \'default\') {'. PHP_EOL;
93
-            echo 'positionSelector = \'.buttonSet\''. PHP_EOL;
94
-            echo '}'. PHP_EOL;
88
+            echo '<script>'.PHP_EOL;
89
+            echo '        function loadPromoted()'.PHP_EOL;
90
+            echo '        {'.PHP_EOL;
91
+            echo 'var positionSelector = \''.$this->extraConfig['PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR'].'\';'.PHP_EOL;
92
+            echo 'if (positionSelector === \'default\') {'.PHP_EOL;
93
+            echo 'positionSelector = \'.buttonSet\''.PHP_EOL;
94
+            echo '}'.PHP_EOL;
95 95
             echo 'var docFather = document.querySelector(positionSelector);'.PHP_EOL;
96
-            echo 'if (typeof docFather != \'undefined\') {'. PHP_EOL;
96
+            echo 'if (typeof docFather != \'undefined\') {'.PHP_EOL;
97 97
             echo 'var promotedNode = document.getElementById("promotedText");'.PHP_EOL;
98 98
             echo 'docFather.appendChild(promotedNode);'.PHP_EOL;
99
-            echo 'promotedNode.style.display=""' . PHP_EOL;
100
-            echo '               clearInterval(window.OSPromotedId);'. PHP_EOL;
101
-            echo '               return true;'. PHP_EOL;
102
-            echo '       }'. PHP_EOL;
103
-            echo '               return false;'. PHP_EOL;
104
-            echo '       }'. PHP_EOL;
105
-            echo '       window.OSPromotedId = setInterval(function () {'. PHP_EOL;
106
-            echo '          loadPromoted();'. PHP_EOL;
107
-            echo '       }, 2000);'. PHP_EOL;
108
-            echo '</script>'. PHP_EOL;
99
+            echo 'promotedNode.style.display=""'.PHP_EOL;
100
+            echo '               clearInterval(window.OSPromotedId);'.PHP_EOL;
101
+            echo '               return true;'.PHP_EOL;
102
+            echo '       }'.PHP_EOL;
103
+            echo '               return false;'.PHP_EOL;
104
+            echo '       }'.PHP_EOL;
105
+            echo '       window.OSPromotedId = setInterval(function () {'.PHP_EOL;
106
+            echo '          loadPromoted();'.PHP_EOL;
107
+            echo '       }, 2000);'.PHP_EOL;
108
+            echo '</script>'.PHP_EOL;
109 109
         }
110 110
 
111 111
         if (isset($productId) || $checkoutPage) {
@@ -124,101 +124,101 @@  discard block
 block discarded – undo
124 124
                 $productId = array_shift($productId);
125 125
                 $promotedProduct = $this->isPromoted($productId);
126 126
                 if ($promotedProduct) {
127
-                    $promotedAmount+=number_format(($item['price'] * $item['qty']), 2);
127
+                    $promotedAmount += number_format(($item['price'] * $item['qty']), 2);
128 128
                 }
129 129
             }
130 130
 
131
-            echo "<script src='".$this->sdkFile."'></script>". PHP_EOL;
132
-            echo '<script>'. PHP_EOL;
133
-            echo '        function loadSimulator()'. PHP_EOL;
134
-            echo '        {'. PHP_EOL;
135
-            echo '           if (typeof '.$simulatorCode.' != \'undefined\') {'. PHP_EOL;
136
-            echo '               var positionSelector = \'' . $this->extraConfig['PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR']. '\';'. PHP_EOL;
137
-            echo '               var priceSelector = \'' . $this->extraConfig['PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR']. '\';'. PHP_EOL;
138
-            echo '               var checkoutPriceSelector = \'' . $this->extraConfig['PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR']. '\';'. PHP_EOL;
139
-            echo '               var quantitySelector = \'' . $this->extraConfig['PAGANTIS_SIMULATOR_CSS_QUANTITY_SELECTOR']. '\';'. PHP_EOL;
140
-            echo '               var checkoutPage =     \'' . $checkoutPage.'\';'. PHP_EOL;
141
-            echo '               var promotedAmount =     \'' . $promotedAmount.'\';'. PHP_EOL;
142
-
143
-            echo '               if (positionSelector === \'default\') {'. PHP_EOL;
144
-            echo '                   positionSelector = \'.buttonSet\''. PHP_EOL;
145
-            echo '               }'. PHP_EOL;
146
-
147
-            echo '               if (priceSelector === \'default\') {'. PHP_EOL;
148
-            echo '                   priceSelector = \'#bodyContent>form>div>h1\''. PHP_EOL;
149
-            echo '               }'. PHP_EOL;
150
-
151
-            echo '               if (checkoutPriceSelector == \'default\' && checkoutPage == \'1\')  {'. PHP_EOL;
152
-            echo '                   priceSelector = \'#columnRight > .infoBoxContainer > .infoBoxContents > tbody > tr:last-child > td\';'. PHP_EOL;
153
-            echo '               }'. PHP_EOL;
154
-            echo '               '.$simulatorCode.'.product_simulator = {};'. PHP_EOL;
155
-            echo '               '.$simulatorCode.'.product_simulator.id = \'product-simulator\';'. PHP_EOL;
156
-            echo '               '.$simulatorCode.'.product_simulator.publicKey = \'' . $this->pk . '\';'. PHP_EOL;
157
-            echo '               '.$simulatorCode.'.product_simulator.selector = positionSelector;'. PHP_EOL;
158
-            echo '               '.$simulatorCode.'.product_simulator.numInstalments = \'' . $this->extraConfig['PAGANTIS_SIMULATOR_START_INSTALLMENTS'] . '\';'. PHP_EOL;
159
-            echo '               '.$simulatorCode.'.product_simulator.type = ' . $this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_TYPE'] . ';'. PHP_EOL;
160
-            echo '               '.$simulatorCode.'.product_simulator.skin = ' . $this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_SKIN'] . ';'. PHP_EOL;
161
-            echo '               '.$simulatorCode.'.product_simulator.position = ' . $this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'] . ';'. PHP_EOL;
131
+            echo "<script src='".$this->sdkFile."'></script>".PHP_EOL;
132
+            echo '<script>'.PHP_EOL;
133
+            echo '        function loadSimulator()'.PHP_EOL;
134
+            echo '        {'.PHP_EOL;
135
+            echo '           if (typeof '.$simulatorCode.' != \'undefined\') {'.PHP_EOL;
136
+            echo '               var positionSelector = \''.$this->extraConfig['PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR'].'\';'.PHP_EOL;
137
+            echo '               var priceSelector = \''.$this->extraConfig['PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR'].'\';'.PHP_EOL;
138
+            echo '               var checkoutPriceSelector = \''.$this->extraConfig['PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR'].'\';'.PHP_EOL;
139
+            echo '               var quantitySelector = \''.$this->extraConfig['PAGANTIS_SIMULATOR_CSS_QUANTITY_SELECTOR'].'\';'.PHP_EOL;
140
+            echo '               var checkoutPage =     \''.$checkoutPage.'\';'.PHP_EOL;
141
+            echo '               var promotedAmount =     \''.$promotedAmount.'\';'.PHP_EOL;
142
+
143
+            echo '               if (positionSelector === \'default\') {'.PHP_EOL;
144
+            echo '                   positionSelector = \'.buttonSet\''.PHP_EOL;
145
+            echo '               }'.PHP_EOL;
146
+
147
+            echo '               if (priceSelector === \'default\') {'.PHP_EOL;
148
+            echo '                   priceSelector = \'#bodyContent>form>div>h1\''.PHP_EOL;
149
+            echo '               }'.PHP_EOL;
150
+
151
+            echo '               if (checkoutPriceSelector == \'default\' && checkoutPage == \'1\')  {'.PHP_EOL;
152
+            echo '                   priceSelector = \'#columnRight > .infoBoxContainer > .infoBoxContents > tbody > tr:last-child > td\';'.PHP_EOL;
153
+            echo '               }'.PHP_EOL;
154
+            echo '               '.$simulatorCode.'.product_simulator = {};'.PHP_EOL;
155
+            echo '               '.$simulatorCode.'.product_simulator.id = \'product-simulator\';'.PHP_EOL;
156
+            echo '               '.$simulatorCode.'.product_simulator.publicKey = \''.$this->pk.'\';'.PHP_EOL;
157
+            echo '               '.$simulatorCode.'.product_simulator.selector = positionSelector;'.PHP_EOL;
158
+            echo '               '.$simulatorCode.'.product_simulator.numInstalments = \''.$this->extraConfig['PAGANTIS_SIMULATOR_START_INSTALLMENTS'].'\';'.PHP_EOL;
159
+            echo '               '.$simulatorCode.'.product_simulator.type = '.$this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_TYPE'].';'.PHP_EOL;
160
+            echo '               '.$simulatorCode.'.product_simulator.skin = '.$this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_SKIN'].';'.PHP_EOL;
161
+            echo '               '.$simulatorCode.'.product_simulator.position = '.$this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'].';'.PHP_EOL;
162 162
 
163 163
             //Amount in product page
164
-            echo '               var promotedProduct = \'' . $this->isPromoted($productId) .'\';'. PHP_EOL;
164
+            echo '               var promotedProduct = \''.$this->isPromoted($productId).'\';'.PHP_EOL;
165 165
             echo '               if(checkoutPage != \'1\' ) {';
166
-            echo '               '.$simulatorCode.'.product_simulator.itemAmountSelector = priceSelector;'. PHP_EOL;
167
-            echo '                   if(promotedProduct == \'1\') { ' . PHP_EOL;
168
-            echo '                    '.$simulatorCode.'.product_simulator.itemPromotedAmountSelector = priceSelector;'. PHP_EOL;
169
-            echo '                   }' . PHP_EOL;
166
+            echo '               '.$simulatorCode.'.product_simulator.itemAmountSelector = priceSelector;'.PHP_EOL;
167
+            echo '                   if(promotedProduct == \'1\') { '.PHP_EOL;
168
+            echo '                    '.$simulatorCode.'.product_simulator.itemPromotedAmountSelector = priceSelector;'.PHP_EOL;
169
+            echo '                   }'.PHP_EOL;
170 170
             echo '               }';
171 171
 
172 172
             //Amount in checkout page
173
-            echo '               if(checkoutPage == \'1\' ) { ' . PHP_EOL;
174
-            echo '               '.$simulatorCode.'.product_simulator.totalAmountSelector = priceSelector;'. PHP_EOL;
175
-            echo '                  if(promotedAmount != \'0\' && checkoutPage == \'1\' ) { ' . PHP_EOL;
176
-            echo '                  '   .$simulatorCode.'.product_simulator.totalPromotedAmount = promotedAmount;'. PHP_EOL;
177
-            echo '                  }' . PHP_EOL;
178
-            echo '               }' . PHP_EOL;
179
-            echo '               '.$simulatorCode.'.simulator.init('.$simulatorCode.'.product_simulator);'. PHP_EOL;
180
-            echo '               clearInterval(window.OSSimulatorId);'. PHP_EOL;
181
-            echo '               return true;'. PHP_EOL;
182
-            echo '           }'. PHP_EOL;
183
-            echo '           return false;'. PHP_EOL;
184
-            echo '       }'. PHP_EOL;
185
-            echo '       window.OSSimulatorId = setInterval(function () {'. PHP_EOL;
186
-            echo '          loadSimulator();'. PHP_EOL;
187
-            echo '       }, 2000);'. PHP_EOL;
188
-            echo '</script>'. PHP_EOL;
173
+            echo '               if(checkoutPage == \'1\' ) { '.PHP_EOL;
174
+            echo '               '.$simulatorCode.'.product_simulator.totalAmountSelector = priceSelector;'.PHP_EOL;
175
+            echo '                  if(promotedAmount != \'0\' && checkoutPage == \'1\' ) { '.PHP_EOL;
176
+            echo '                  '.$simulatorCode.'.product_simulator.totalPromotedAmount = promotedAmount;'.PHP_EOL;
177
+            echo '                  }'.PHP_EOL;
178
+            echo '               }'.PHP_EOL;
179
+            echo '               '.$simulatorCode.'.simulator.init('.$simulatorCode.'.product_simulator);'.PHP_EOL;
180
+            echo '               clearInterval(window.OSSimulatorId);'.PHP_EOL;
181
+            echo '               return true;'.PHP_EOL;
182
+            echo '           }'.PHP_EOL;
183
+            echo '           return false;'.PHP_EOL;
184
+            echo '       }'.PHP_EOL;
185
+            echo '       window.OSSimulatorId = setInterval(function () {'.PHP_EOL;
186
+            echo '          loadSimulator();'.PHP_EOL;
187
+            echo '       }, 2000);'.PHP_EOL;
188
+            echo '</script>'.PHP_EOL;
189 189
 
190 190
             //Checkout simulator
191 191
             if ($checkoutPage) {
192
-                echo '<script>' . PHP_EOL;
193
-                echo 'function checkSelected(value)'. PHP_EOL;
194
-                echo '{ '. PHP_EOL;
195
-                echo 'var simulator = document.getElementsByClassName("buttonSet");'  . PHP_EOL;
196
-                echo ' if(simulator == "undefined") { return false;  } '. PHP_EOL;
197
-                echo 'var pagantisCheckbox = document.querySelector("input[value=\'pagantis\']"); ' . PHP_EOL;
198
-                echo 'var grandparentNode = pagantisCheckbox.parentNode.parentNode;' . PHP_EOL;
199
-                echo 'if(grandparentNode == value) { var status="" } ' . PHP_EOL;
200
-                echo 'else { var status="none";} '. PHP_EOL;
201
-                echo 'simulator[0].style.display=status; ' . PHP_EOL;
202
-                echo '}'. PHP_EOL;
203
-
204
-                echo 'function showSimulator()'. PHP_EOL;
205
-                echo '{'. PHP_EOL;
206
-                echo 'var elements = document.querySelectorAll("tr[class^=\'moduleRow\']");' . PHP_EOL;
207
-                echo 'if(elements == null) { return false };' . PHP_EOL;
192
+                echo '<script>'.PHP_EOL;
193
+                echo 'function checkSelected(value)'.PHP_EOL;
194
+                echo '{ '.PHP_EOL;
195
+                echo 'var simulator = document.getElementsByClassName("buttonSet");'.PHP_EOL;
196
+                echo ' if(simulator == "undefined") { return false;  } '.PHP_EOL;
197
+                echo 'var pagantisCheckbox = document.querySelector("input[value=\'pagantis\']"); '.PHP_EOL;
198
+                echo 'var grandparentNode = pagantisCheckbox.parentNode.parentNode;'.PHP_EOL;
199
+                echo 'if(grandparentNode == value) { var status="" } '.PHP_EOL;
200
+                echo 'else { var status="none";} '.PHP_EOL;
201
+                echo 'simulator[0].style.display=status; '.PHP_EOL;
202
+                echo '}'.PHP_EOL;
203
+
204
+                echo 'function showSimulator()'.PHP_EOL;
205
+                echo '{'.PHP_EOL;
206
+                echo 'var elements = document.querySelectorAll("tr[class^=\'moduleRow\']");'.PHP_EOL;
207
+                echo 'if(elements == null) { return false };'.PHP_EOL;
208 208
 
209 209
                 echo 'for(var i = 0, max = elements.length; i < max; i++) { elements[i].onclick = function() {
210 210
                         checkSelected(this);
211 211
                     } }' . PHP_EOL;
212 212
                 echo 'clearInterval(window.OSdisplayId);';
213
-                echo 'return true;'. PHP_EOL;
214
-                echo '};'. PHP_EOL;
213
+                echo 'return true;'.PHP_EOL;
214
+                echo '};'.PHP_EOL;
215 215
 
216
-                echo '       window.OSdisplayId = setInterval(function () {'. PHP_EOL;
217
-                echo '          showSimulator();'. PHP_EOL;
218
-                echo '       }, 2000);'. PHP_EOL;
216
+                echo '       window.OSdisplayId = setInterval(function () {'.PHP_EOL;
217
+                echo '          showSimulator();'.PHP_EOL;
218
+                echo '       }, 2000);'.PHP_EOL;
219 219
 
220 220
 
221
-                echo '</script>'. PHP_EOL;
221
+                echo '</script>'.PHP_EOL;
222 222
             }
223 223
         }
224 224
     }
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
      * install
242 242
      */
243 243
     function install() {
244
-        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Pagantis Module', 'MODULE_HEADER_TAGS_PAGANTIS_STATUS', 'True', '', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
244
+        tep_db_query("insert into ".TABLE_CONFIGURATION." (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Pagantis Module', 'MODULE_HEADER_TAGS_PAGANTIS_STATUS', 'True', '', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
245 245
 
246 246
     }
247 247
 
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
      * remove
250 250
      */
251 251
     function remove() {
252
-        tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
252
+        tep_db_query("delete from ".TABLE_CONFIGURATION." where configuration_key in ('".implode("', '", $this->keys())."')");
253 253
     }
254 254
 
255 255
     /**
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
 
276 276
         if ($this->extraConfig['PAGANTIS_PROMOTION'] == '') {
277 277
             $promotedProducts = array();
278
-        } else {
278
+        }else {
279 279
             $promotedProducts = array_values((array)unserialize($this->extraConfig['PAGANTIS_PROMOTION']));
280 280
         }
281 281
 
Please login to merge, or discard this patch.
catalog/includes/modules/payment/pagantis.php 2 patches
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -67,8 +67,8 @@  discard block
 block discarded – undo
67 67
 
68 68
         if (strpos($_SERVER[REQUEST_URI], "checkout_payment.php") <= 0) {
69 69
             $this->title = MODULE_PAYMENT_PAGANTIS_TEXT_ADMIN_TITLE; // Payment module title in Admin
70
-        } else {
71
-            $this->title = $this->extraConfig['PAGANTIS_TITLE'] .'<br/><br/><div class="buttonSet" style="display:none"></div><br/>'; // Payment module title in Catalog
70
+        }else {
71
+            $this->title = $this->extraConfig['PAGANTIS_TITLE'].'<br/><br/><div class="buttonSet" style="display:none"></div><br/>'; // Payment module title in Catalog
72 72
         }
73 73
 
74 74
         $this->enabled = ((MODULE_PAYMENT_PAGANTIS_STATUS == 'True') ? true : false);
@@ -78,12 +78,12 @@  discard block
 block discarded – undo
78 78
                 "%s://%s%s%s",
79 79
                 isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https' : 'http',
80 80
                 $_SERVER['SERVER_NAME'],
81
-                isset($_SERVER['SERVER_PORT']) ? ":" . $_SERVER['SERVER_PORT'] : '',
81
+                isset($_SERVER['SERVER_PORT']) ? ":".$_SERVER['SERVER_PORT'] : '',
82 82
                 $_SERVER['REQUEST_URI']
83 83
             )
84 84
         );
85 85
 
86
-        $this->form_action_url = $this->base_url . '/ext/modules/payment/pagantis/bypass.php';
86
+        $this->form_action_url = $this->base_url.'/ext/modules/payment/pagantis/bypass.php';
87 87
 
88 88
         if (defined('MODULE_PAYMENT_PAGANTIS_LANG_CODE')) {
89 89
             $this->langCode = MODULE_PAYMENT_PAGANTIS_LANG_CODE;
@@ -186,14 +186,14 @@  discard block
 block discarded – undo
186 186
                 throw new UnknownException("Order not found");
187 187
             }
188 188
 
189
-            $id_hash = time() . serialize($order->products) . '' . serialize($order->customer) . '' . serialize($order->delivery);
189
+            $id_hash = time().serialize($order->products).''.serialize($order->customer).''.serialize($order->delivery);
190 190
             $this->os_order_reference = md5($id_hash);
191 191
             $_SESSION['order_id'] = $this->os_order_reference;
192 192
 
193 193
             $userAddress = new Address();
194 194
             $userAddress
195 195
                 ->setZipCode($order->billing['postcode'])
196
-                ->setFullName($order->billing['firstname'] . ' ' . $order->billing['lastname'])
196
+                ->setFullName($order->billing['firstname'].' '.$order->billing['lastname'])
197 197
                 ->setCountryCode('ES')
198 198
                 ->setCity($order->billing['city'])
199 199
                 ->setAddress($order->billing['street_address'])
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
             $orderShippingAddress = new Address();
206 206
             $orderShippingAddress
207 207
                 ->setZipCode($order->delivery['postcode'])
208
-                ->setFullName($order->billing['firstname'] . ' ' . $order->billing['lastname'])
208
+                ->setFullName($order->billing['firstname'].' '.$order->billing['lastname'])
209 209
                 ->setCountryCode('ES')
210 210
                 ->setCity($order->delivery['city'])
211 211
                 ->setAddress($order->delivery['street_address'])
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
             $orderUser = new \Pagantis\OrdersApiClient\Model\Order\User();
216 216
             $orderUser
217 217
                 ->setAddress($userAddress)
218
-                ->setFullName($order->billing['firstname'] . ' ' . $order->billing['lastname'])
218
+                ->setFullName($order->billing['firstname'].' '.$order->billing['lastname'])
219 219
                 ->setBillingAddress($orderBillingAddress)
220 220
                 ->setEmail($order->customer['email_address'])
221 221
                 ->setFixPhone($order->customer['telephone'])
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
                     ->setQuantity(intval($item['qty']))
255 255
                     ->setDescription($item['name']);
256 256
                 if ($promotedProduct) {
257
-                    $promotedAmount+=$product->getAmount();
257
+                    $promotedAmount += $product->getAmount();
258 258
                     $promotedMessage = $product->getDescription()."-Price:".$item['final_price']."-Qty:".$product->getQuantity();
259 259
                     $metadataOrder->addMetadata('promotedProduct', $promotedMessage);
260 260
                 }
@@ -274,9 +274,9 @@  discard block
 block discarded – undo
274 274
             );
275 275
 
276 276
             $cancelUrl = trim(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL', false));
277
-            if ($this->extraConfig['PAGANTIS_URL_KO']!='') {
277
+            if ($this->extraConfig['PAGANTIS_URL_KO'] != '') {
278 278
                 $koUrl = $this->extraConfig['PAGANTIS_URL_KO'];
279
-            } else {
279
+            }else {
280 280
                 $koUrl = $cancelUrl;
281 281
             }
282 282
 
@@ -312,16 +312,16 @@  discard block
 block discarded – undo
312 312
             if ($pagantisOrder instanceof \Pagantis\OrdersApiClient\Model\Order) {
313 313
                 $url = $pagantisOrder->getActionUrls()->getForm();
314 314
                 $this->insertRow($this->os_order_reference, $pagantisOrder->getId(), serialize($global_vars));
315
-            } else {
315
+            }else {
316 316
                 throw new OrderNotFoundException();
317 317
             }
318 318
 
319 319
             if ($url == "") {
320 320
                 throw new UnknownException(_("No ha sido posible obtener una respuesta de Pagantis"));
321
-            } else {
321
+            }else {
322 322
                 $output = "\n";
323
-                $output .= tep_draw_hidden_field("formUrl", $url) . "\n";
324
-                $output .= tep_draw_hidden_field("cancelUrl", $cancelUrl) . "\n";
323
+                $output .= tep_draw_hidden_field("formUrl", $url)."\n";
324
+                $output .= tep_draw_hidden_field("cancelUrl", $cancelUrl)."\n";
325 325
                 return $output;
326 326
 
327 327
             } //TODO IFRAME
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
             return 'failed';
388 388
         }
389 389
 
390
-        tep_db_query("insert into " . TABLE_CONFIGURATION . "
390
+        tep_db_query("insert into ".TABLE_CONFIGURATION."
391 391
         (
392 392
             configuration_title,
393 393
             configuration_key,
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
             ',
411 411
             now()
412 412
         )");
413
-        tep_db_query("insert into " . TABLE_CONFIGURATION . "
413
+        tep_db_query("insert into ".TABLE_CONFIGURATION."
414 414
         (
415 415
             configuration_title,
416 416
             configuration_key,
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
             '0',
431 431
             now()
432 432
         )");
433
-        tep_db_query("insert into " . TABLE_CONFIGURATION . "
433
+        tep_db_query("insert into ".TABLE_CONFIGURATION."
434 434
         (
435 435
             configuration_title,
436 436
             configuration_key,
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
             '0',
451 451
             now()
452 452
         )");
453
-        tep_db_query("insert into " . TABLE_CONFIGURATION . "
453
+        tep_db_query("insert into ".TABLE_CONFIGURATION."
454 454
         (
455 455
             configuration_title,
456 456
             configuration_key,
@@ -482,14 +482,14 @@  discard block
 block discarded – undo
482 482
      */
483 483
     private function installPagantisTables()
484 484
     {
485
-        $sql = "CREATE TABLE IF NOT EXISTS " . TABLE_PAGANTIS_LOG . " ( 
485
+        $sql = "CREATE TABLE IF NOT EXISTS ".TABLE_PAGANTIS_LOG." ( 
486 486
                           id int NOT NULL AUTO_INCREMENT, 
487 487
                           log text NOT NULL, 
488 488
                           createdAt timestamp DEFAULT CURRENT_TIMESTAMP, 
489 489
                           UNIQUE KEY id (id))";
490 490
         tep_db_query($sql);
491 491
 
492
-        $sql = "CREATE TABLE IF NOT EXISTS " . TABLE_PAGANTIS_CONFIG . " (
492
+        $sql = "CREATE TABLE IF NOT EXISTS ".TABLE_PAGANTIS_CONFIG." (
493 493
                             id int NOT NULL AUTO_INCREMENT, 
494 494
                             config varchar(60) NOT NULL, 
495 495
                             value varchar(200) NOT NULL, 
@@ -497,10 +497,10 @@  discard block
 block discarded – undo
497 497
         tep_db_query($sql);
498 498
 
499 499
         // check if table has records
500
-        $check_query = tep_db_query("select value from " . TABLE_PAGANTIS_CONFIG);
500
+        $check_query = tep_db_query("select value from ".TABLE_PAGANTIS_CONFIG);
501 501
         if (tep_db_num_rows($check_query) === 0) {
502 502
             foreach ((array)$this->defaultConfigs as $configKey => $configValue) {
503
-                $query = "INSERT INTO " . TABLE_PAGANTIS_CONFIG . "
503
+                $query = "INSERT INTO ".TABLE_PAGANTIS_CONFIG."
504 504
                 (
505 505
                     config,
506 506
                     value
@@ -514,7 +514,7 @@  discard block
 block discarded – undo
514 514
             }
515 515
         }
516 516
 
517
-        $sql = "CREATE TABLE IF NOT EXISTS " . TABLE_PAGANTIS_ORDERS . " (
517
+        $sql = "CREATE TABLE IF NOT EXISTS ".TABLE_PAGANTIS_ORDERS." (
518 518
                             id int NOT NULL AUTO_INCREMENT, 
519 519
                             os_order_id varchar(50), 
520 520
                             os_order_reference varchar(50) NOT NULL,
@@ -523,7 +523,7 @@  discard block
 block discarded – undo
523 523
                             UNIQUE KEY id(id))";
524 524
         tep_db_query($sql);
525 525
 
526
-        $sql = "CREATE TABLE IF NOT EXISTS " . TABLE_PAGANTIS_CONCURRENCY . " (
526
+        $sql = "CREATE TABLE IF NOT EXISTS ".TABLE_PAGANTIS_CONCURRENCY." (
527 527
                             id varchar(50) NOT NULL,
528 528
                             `timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
529 529
                             UNIQUE KEY id(id))";
@@ -535,29 +535,29 @@  discard block
 block discarded – undo
535 535
      */
536 536
     public function remove()
537 537
     {
538
-        $checkTable = tep_db_query("SHOW TABLES LIKE '" . TABLE_PAGANTIS_LOG . "'");
538
+        $checkTable = tep_db_query("SHOW TABLES LIKE '".TABLE_PAGANTIS_LOG."'");
539 539
         if (tep_db_num_rows($checkTable) > 0) {
540
-            tep_db_query("drop table " . TABLE_PAGANTIS_LOG);
540
+            tep_db_query("drop table ".TABLE_PAGANTIS_LOG);
541 541
         }
542 542
 
543
-        $checkTable = tep_db_query("SHOW TABLES LIKE '" . TABLE_PAGANTIS_CONFIG . "'");
543
+        $checkTable = tep_db_query("SHOW TABLES LIKE '".TABLE_PAGANTIS_CONFIG."'");
544 544
         if (tep_db_num_rows($checkTable) > 0) {
545
-            tep_db_query("drop table " . TABLE_PAGANTIS_CONFIG);
545
+            tep_db_query("drop table ".TABLE_PAGANTIS_CONFIG);
546 546
         }
547 547
 
548
-        $checkTable = tep_db_query("SHOW TABLES LIKE '" . TABLE_PAGANTIS_ORDERS . "'");
548
+        $checkTable = tep_db_query("SHOW TABLES LIKE '".TABLE_PAGANTIS_ORDERS."'");
549 549
         if (tep_db_num_rows($checkTable) > 0) {
550
-            tep_db_query("drop table " . TABLE_PAGANTIS_ORDERS);
550
+            tep_db_query("drop table ".TABLE_PAGANTIS_ORDERS);
551 551
         }
552 552
 
553
-        $checkTable = tep_db_query("SHOW TABLES LIKE '" . TABLE_PAGANTIS_CONCURRENCY . "'");
553
+        $checkTable = tep_db_query("SHOW TABLES LIKE '".TABLE_PAGANTIS_CONCURRENCY."'");
554 554
         if (tep_db_num_rows($checkTable) > 0) {
555
-            tep_db_query("drop table " . TABLE_PAGANTIS_CONCURRENCY);
555
+            tep_db_query("drop table ".TABLE_PAGANTIS_CONCURRENCY);
556 556
         }
557 557
 
558
-        tep_db_query("DELETE FROM ". TABLE_CONFIGURATION ." where configuration_key in ('MODULE_PAYMENT_PAGANTIS_STATUS','MODULE_PAYMENT_PAGANTIS_PK','MODULE_PAYMENT_PAGANTIS_SK')");
558
+        tep_db_query("DELETE FROM ".TABLE_CONFIGURATION." where configuration_key in ('MODULE_PAYMENT_PAGANTIS_STATUS','MODULE_PAYMENT_PAGANTIS_PK','MODULE_PAYMENT_PAGANTIS_SK')");
559 559
 
560
-        $query = "delete from " . TABLE_CONFIGURATION . " where configuration_key like '%_PAGANTIS_%'";
560
+        $query = "delete from ".TABLE_CONFIGURATION." where configuration_key like '%_PAGANTIS_%'";
561 561
         tep_db_query($query);
562 562
 
563 563
         $this->uninstallSimulator();
@@ -612,13 +612,13 @@  discard block
 block discarded – undo
612 612
      */
613 613
     private function insertRow($orderId, $pagantisOrderId, $globalVars)
614 614
     {
615
-        $query = "select * from " . TABLE_PAGANTIS_ORDERS . " where os_order_reference='$orderId'";
615
+        $query = "select * from ".TABLE_PAGANTIS_ORDERS." where os_order_reference='$orderId'";
616 616
         $resultsSelect = tep_db_query($query);
617 617
         $countResults = tep_db_num_rows($resultsSelect);
618 618
         if ($countResults == 0) {
619
-            $query = "INSERT INTO " . TABLE_PAGANTIS_ORDERS . " 
619
+            $query = "INSERT INTO ".TABLE_PAGANTIS_ORDERS." 
620 620
                 (os_order_reference, pagantis_order_id, globals) values ('$orderId', '$pagantisOrderId','$globalVars')";
621
-        } else {
621
+        }else {
622 622
             $query = "UPDATE ".TABLE_PAGANTIS_ORDERS." set pagantis_order_id='$pagantisOrderId' 
623 623
                         where os_order_reference='$orderId'";
624 624
         }
@@ -659,7 +659,7 @@  discard block
 block discarded – undo
659 659
 
660 660
         if ($this->extraConfig['PAGANTIS_PROMOTION'] == '') {
661 661
             $promotedProducts = array();
662
-        } else {
662
+        }else {
663 663
             $promotedProducts = array_values((array)unserialize($this->extraConfig['PAGANTIS_PROMOTION']));
664 664
         }
665 665
 
@@ -672,13 +672,13 @@  discard block
 block discarded – undo
672 672
     private function getDescription()
673 673
     {
674 674
         $descriptionCode = "<img src=\"images/icon_info.gif\" border=\"0\" alt=\"Info\" title=\"Info\">&nbsp;<strong>Module version:</strong> $this->version<br/><br/>";
675
-        $descriptionCode.= "<img src=\"images/icon_info.gif\" border=\"0\">&nbsp;<a href='https://developer.pagantis.com/' target=\"_blank\" style=\"text-decoration: underline; font-weight: bold;\">View Online Documentation</a><br/><br/>";
676
-        $descriptionCode.= "<img src='images/icon_popup.gif'  border='0'>        <a href='http://pagantis.com' target='_blank' style='text-decoration: underline; font-weight: bold;'>Visit Pagantis Website</a><br/><br/><br/>";
675
+        $descriptionCode .= "<img src=\"images/icon_info.gif\" border=\"0\">&nbsp;<a href='https://developer.pagantis.com/' target=\"_blank\" style=\"text-decoration: underline; font-weight: bold;\">View Online Documentation</a><br/><br/>";
676
+        $descriptionCode .= "<img src='images/icon_popup.gif'  border='0'>        <a href='http://pagantis.com' target='_blank' style='text-decoration: underline; font-weight: bold;'>Visit Pagantis Website</a><br/><br/><br/>";
677 677
 
678 678
         if (MODULE_PAYMENT_PAGANTIS_STATUS == 'True' && $this->isPromoted(null)) {
679 679
             $pagantisPromotionUrl = $this->base_url.'/admin/promotion.php';
680 680
             $linkDescription = "Si desea gestionar los productos promocionados pulse aquí";
681
-            $descriptionCode.= "<a href='$pagantisPromotionUrl'>$linkDescription</a>";
681
+            $descriptionCode .= "<a href='$pagantisPromotionUrl'>$linkDescription</a>";
682 682
         }
683 683
 
684 684
         return $descriptionCode;
@@ -689,34 +689,34 @@  discard block
 block discarded – undo
689 689
      */
690 690
     private function installSimulator()
691 691
     {
692
-        $checkSimulator = tep_db_query("select configuration_key, configuration_value from " .TABLE_CONFIGURATION ." 
692
+        $checkSimulator = tep_db_query("select configuration_key, configuration_value from ".TABLE_CONFIGURATION." 
693 693
                                     where configuration_key like 'MODULE_HEADER_TAGS_INSTALLED'
694 694
                                     and configuration_value like '%ht_pagantis.php%';");
695 695
         if (tep_db_num_rows($checkSimulator) > 0) {
696 696
             return true;
697 697
         }
698 698
 
699
-        $query = "UPDATE " . TABLE_CONFIGURATION . " set configuration_value = concat(configuration_value, ';ht_pagantis.php')
699
+        $query = "UPDATE ".TABLE_CONFIGURATION." set configuration_value = concat(configuration_value, ';ht_pagantis.php')
700 700
                         where configuration_key like 'MODULE_HEADER_TAGS_INSTALLED'";
701 701
         tep_db_query($query);
702 702
 
703
-        tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Pagantis Module', 'MODULE_HEADER_TAGS_PAGANTIS_STATUS', 'True', '', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
703
+        tep_db_query("insert into ".TABLE_CONFIGURATION." (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Pagantis Module', 'MODULE_HEADER_TAGS_PAGANTIS_STATUS', 'True', '', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
704 704
     }
705 705
 
706 706
     private function uninstallSimulator()
707 707
     {
708
-        $checkSimulator = tep_db_query("select configuration_key, configuration_value from " .TABLE_CONFIGURATION ." 
708
+        $checkSimulator = tep_db_query("select configuration_key, configuration_value from ".TABLE_CONFIGURATION." 
709 709
                                     where configuration_key like 'MODULE_HEADER_TAGS_INSTALLED'
710 710
                                     and configuration_value like '%ht_pagantis.php%';");
711 711
         if (tep_db_num_rows($checkSimulator) == 0) {
712 712
             return true;
713 713
         }
714 714
 
715
-        $query = "UPDATE " . TABLE_CONFIGURATION . " set configuration_value = REPLACE(configuration_value, ';ht_pagantis.php', '')
715
+        $query = "UPDATE ".TABLE_CONFIGURATION." set configuration_value = REPLACE(configuration_value, ';ht_pagantis.php', '')
716 716
                         where configuration_key like 'MODULE_HEADER_TAGS_INSTALLED'";
717 717
         tep_db_query($query);
718 718
 
719
-        $query = "delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_HEADER_TAGS_PAGANTIS_STATUS'";
719
+        $query = "delete from ".TABLE_CONFIGURATION." where configuration_key = 'MODULE_HEADER_TAGS_PAGANTIS_STATUS'";
720 720
         tep_db_query($query);
721 721
     }
722 722
 }
Please login to merge, or discard this patch.
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -35,23 +35,23 @@  discard block
 block discarded – undo
35 35
     public $langCode = null;
36 36
 
37 37
     public $defaultConfigs = array('PAGANTIS_TITLE'=>'Instant Financing',
38
-                                   'PAGANTIS_SIMULATOR_DISPLAY_TYPE'=>'pgSDK.simulator.types.SIMPLE',
39
-                                   'PAGANTIS_SIMULATOR_DISPLAY_SKIN'=>'pgSDK.simulator.skins.BLUE',
40
-                                   'PAGANTIS_SIMULATOR_DISPLAY_POSITION'=>'hookDisplayProductButtons',
41
-                                   'PAGANTIS_SIMULATOR_START_INSTALLMENTS'=>3,
42
-                                   'PAGANTIS_SIMULATOR_MAX_INSTALLMENTS'=>12,
43
-                                   'PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR'=>'default',
44
-                                   'PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'=>'pgSDK.simulator.positions.INNER',
45
-                                   'PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR'=>'default',
46
-                                   'PAGANTIS_SIMULATOR_CSS_QUANTITY_SELECTOR'=>'default',
47
-                                   'PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR_CHECKOUT'=>'default',
48
-                                   'PAGANTIS_FORM_DISPLAY_TYPE'=>0,
49
-                                   'PAGANTIS_DISPLAY_MIN_AMOUNT'=>1,
50
-                                   'PAGANTIS_URL_OK'=>'',
51
-                                   'PAGANTIS_URL_KO'=>'',
52
-                                   'PAGANTIS_TITLE_EXTRA' => 'Paga hasta en 12 cómodas cuotas con Paga+Tarde. Solicitud totalmente online y sin papeleos,¡y la respuesta es inmediata!',
53
-                                   'PAGANTIS_PROMOTION' => '',
54
-                                   'PAGANTIS_PROMOTED_PRODUCT_CODE' => '<p>¡Financia este producto sin intereses! - 0% TAE</p>'
38
+                                    'PAGANTIS_SIMULATOR_DISPLAY_TYPE'=>'pgSDK.simulator.types.SIMPLE',
39
+                                    'PAGANTIS_SIMULATOR_DISPLAY_SKIN'=>'pgSDK.simulator.skins.BLUE',
40
+                                    'PAGANTIS_SIMULATOR_DISPLAY_POSITION'=>'hookDisplayProductButtons',
41
+                                    'PAGANTIS_SIMULATOR_START_INSTALLMENTS'=>3,
42
+                                    'PAGANTIS_SIMULATOR_MAX_INSTALLMENTS'=>12,
43
+                                    'PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR'=>'default',
44
+                                    'PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'=>'pgSDK.simulator.positions.INNER',
45
+                                    'PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR'=>'default',
46
+                                    'PAGANTIS_SIMULATOR_CSS_QUANTITY_SELECTOR'=>'default',
47
+                                    'PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR_CHECKOUT'=>'default',
48
+                                    'PAGANTIS_FORM_DISPLAY_TYPE'=>0,
49
+                                    'PAGANTIS_DISPLAY_MIN_AMOUNT'=>1,
50
+                                    'PAGANTIS_URL_OK'=>'',
51
+                                    'PAGANTIS_URL_KO'=>'',
52
+                                    'PAGANTIS_TITLE_EXTRA' => 'Paga hasta en 12 cómodas cuotas con Paga+Tarde. Solicitud totalmente online y sin papeleos,¡y la respuesta es inmediata!',
53
+                                    'PAGANTIS_PROMOTION' => '',
54
+                                    'PAGANTIS_PROMOTED_PRODUCT_CODE' => '<p>¡Financia este producto sin intereses! - 0% TAE</p>'
55 55
     );
56 56
 
57 57
     /**
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
         try {
167 167
             include_once('./ext/modules/payment/pagantis/vendor/autoload.php');
168 168
             global $order, $customer_id, $sendto, $billto, $cart, $languages_id, $currency, $currencies, $shipping,
169
-                   $payment, $comments, $customer_default_address_id, $cartID;
169
+                    $payment, $comments, $customer_default_address_id, $cartID;
170 170
             $global_vars = array();
171 171
             $global_vars['customer_id'] = serialize($customer_id);
172 172
             $global_vars['sendTo'] = serialize($sendto);
Please login to merge, or discard this patch.