@@ -139,7 +139,7 @@ discard block |
||
| 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 |
||
| 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, |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | sleep(3); |
| 97 | 97 | $productLinkElement->click(); |
| 98 | 98 | $this->assertSame( |
| 99 | - self::PRODUCT_NAME . ', ' . self::TITLE, |
|
| 99 | + self::PRODUCT_NAME.', '.self::TITLE, |
|
| 100 | 100 | $this->webDriver->getTitle() |
| 101 | 101 | ); |
| 102 | 102 | } |
@@ -181,9 +181,9 @@ discard block |
||
| 181 | 181 | $paymentFormElement = WebDriverBy::className('FieldsPreview-desc'); |
| 182 | 182 | $condition = WebDriverExpectedCondition::visibilityOfElementLocated($paymentFormElement); |
| 183 | 183 | $this->webDriver->wait()->until($condition); |
| 184 | - $this->assertTrue((bool) $condition); |
|
| 184 | + $this->assertTrue((bool)$condition); |
|
| 185 | 185 | $this->assertSame( |
| 186 | - $this->configuration['firstname'] . ' ' . $this->configuration['lastname'], |
|
| 186 | + $this->configuration['firstname'].' '.$this->configuration['lastname'], |
|
| 187 | 187 | $this->findByClass('FieldsPreview-desc')->getText() |
| 188 | 188 | ); |
| 189 | 189 | } |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | if (strpos($_SERVER[REQUEST_URI], "checkout_payment.php") <= 0) { |
| 62 | 62 | $this->title = MODULE_PAYMENT_PAGANTIS_TEXT_ADMIN_TITLE; // Payment module title in Admin |
| 63 | - } else { |
|
| 63 | + }else { |
|
| 64 | 64 | $this->title = $this->extraConfig['PAGANTIS_TITLE']; // Payment module title in Catalog |
| 65 | 65 | } |
| 66 | 66 | |
@@ -73,12 +73,12 @@ discard block |
||
| 73 | 73 | "%s://%s%s%s", |
| 74 | 74 | isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https' : 'http', |
| 75 | 75 | $_SERVER['SERVER_NAME'], |
| 76 | - isset($_SERVER['SERVER_PORT']) ? ":" . $_SERVER['SERVER_PORT'] : '', |
|
| 76 | + isset($_SERVER['SERVER_PORT']) ? ":".$_SERVER['SERVER_PORT'] : '', |
|
| 77 | 77 | $_SERVER['REQUEST_URI'] |
| 78 | 78 | ) |
| 79 | 79 | ); |
| 80 | 80 | |
| 81 | - $this->form_action_url = $this->base_url . '/ext/modules/payment/pagantis/bypass.php'; |
|
| 81 | + $this->form_action_url = $this->base_url.'/ext/modules/payment/pagantis/bypass.php'; |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | /*************** |
@@ -177,14 +177,14 @@ discard block |
||
| 177 | 177 | throw new UnknownException("Order not found"); |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | - $id_hash = time() . serialize($order->products) . '' . serialize($order->customer) . '' . serialize($order->delivery); |
|
| 180 | + $id_hash = time().serialize($order->products).''.serialize($order->customer).''.serialize($order->delivery); |
|
| 181 | 181 | $this->os_order_reference = md5($id_hash); |
| 182 | 182 | $_SESSION['order_id'] = $this->os_order_reference; |
| 183 | 183 | |
| 184 | 184 | $userAddress = new Address(); |
| 185 | 185 | $userAddress |
| 186 | 186 | ->setZipCode($order->billing['postcode']) |
| 187 | - ->setFullName($order->billing['firstname'] . ' ' . $order->billing['lastname']) |
|
| 187 | + ->setFullName($order->billing['firstname'].' '.$order->billing['lastname']) |
|
| 188 | 188 | ->setCountryCode('ES') |
| 189 | 189 | ->setCity($order->billing['city']) |
| 190 | 190 | ->setAddress($order->billing['street_address']) |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | $orderShippingAddress = new Address(); |
| 197 | 197 | $orderShippingAddress |
| 198 | 198 | ->setZipCode($order->delivery['postcode']) |
| 199 | - ->setFullName($order->billing['firstname'] . ' ' . $order->billing['lastname']) |
|
| 199 | + ->setFullName($order->billing['firstname'].' '.$order->billing['lastname']) |
|
| 200 | 200 | ->setCountryCode('ES') |
| 201 | 201 | ->setCity($order->delivery['city']) |
| 202 | 202 | ->setAddress($order->delivery['street_address']) |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | $orderUser = new \Pagantis\OrdersApiClient\Model\Order\User(); |
| 207 | 207 | $orderUser |
| 208 | 208 | ->setAddress($userAddress) |
| 209 | - ->setFullName($order->billing['firstname'] . ' ' . $order->billing['lastname']) |
|
| 209 | + ->setFullName($order->billing['firstname'].' '.$order->billing['lastname']) |
|
| 210 | 210 | ->setBillingAddress($orderBillingAddress) |
| 211 | 211 | ->setEmail($order->customer['email_address']) |
| 212 | 212 | ->setFixPhone($order->customer['telephone']) |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | ->setQuantity(intval($item['qty'])) |
| 236 | 236 | ->setDescription($item['name']); |
| 237 | 237 | if ($promotedProduct) { |
| 238 | - $promotedAmount+=$product->getAmount(); |
|
| 238 | + $promotedAmount += $product->getAmount(); |
|
| 239 | 239 | } |
| 240 | 240 | $details->addProduct($product); |
| 241 | 241 | } |
@@ -254,9 +254,9 @@ discard block |
||
| 254 | 254 | ); |
| 255 | 255 | |
| 256 | 256 | $cancelUrl = trim(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL', false)); |
| 257 | - if ($this->extraConfig['PAGANTIS_URL_KO']!='') { |
|
| 257 | + if ($this->extraConfig['PAGANTIS_URL_KO'] != '') { |
|
| 258 | 258 | $koUrl = $this->extraConfig['PAGANTIS_URL_KO']; |
| 259 | - } else { |
|
| 259 | + }else { |
|
| 260 | 260 | $koUrl = $cancelUrl; |
| 261 | 261 | } |
| 262 | 262 | |
@@ -301,16 +301,16 @@ discard block |
||
| 301 | 301 | if ($pagantisOrder instanceof \Pagantis\OrdersApiClient\Model\Order) { |
| 302 | 302 | $url = $pagantisOrder->getActionUrls()->getForm(); |
| 303 | 303 | $this->insertRow($this->os_order_reference, $pagantisOrder->getId(), serialize($global_vars)); |
| 304 | - } else { |
|
| 304 | + }else { |
|
| 305 | 305 | throw new OrderNotFoundException(); |
| 306 | 306 | } |
| 307 | 307 | |
| 308 | 308 | if ($url == "") { |
| 309 | 309 | throw new UnknownException(_("No ha sido posible obtener una respuesta de Pagantis")); |
| 310 | - } else { |
|
| 310 | + }else { |
|
| 311 | 311 | $output = "\n"; |
| 312 | - $output .= tep_draw_hidden_field("formUrl", $url) . "\n"; |
|
| 313 | - $output .= tep_draw_hidden_field("cancelUrl", $cancelUrl) . "\n"; |
|
| 312 | + $output .= tep_draw_hidden_field("formUrl", $url)."\n"; |
|
| 313 | + $output .= tep_draw_hidden_field("cancelUrl", $cancelUrl)."\n"; |
|
| 314 | 314 | return $output; |
| 315 | 315 | |
| 316 | 316 | } //TODO IFRAME |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | return 'failed'; |
| 377 | 377 | } |
| 378 | 378 | |
| 379 | - tep_db_query("insert into " . TABLE_CONFIGURATION . " |
|
| 379 | + tep_db_query("insert into ".TABLE_CONFIGURATION." |
|
| 380 | 380 | ( |
| 381 | 381 | configuration_title, |
| 382 | 382 | configuration_key, |
@@ -399,7 +399,7 @@ discard block |
||
| 399 | 399 | ', |
| 400 | 400 | now() |
| 401 | 401 | )"); |
| 402 | - tep_db_query("insert into " . TABLE_CONFIGURATION . " |
|
| 402 | + tep_db_query("insert into ".TABLE_CONFIGURATION." |
|
| 403 | 403 | ( |
| 404 | 404 | configuration_title, |
| 405 | 405 | configuration_key, |
@@ -419,7 +419,7 @@ discard block |
||
| 419 | 419 | '0', |
| 420 | 420 | now() |
| 421 | 421 | )"); |
| 422 | - tep_db_query("insert into " . TABLE_CONFIGURATION . " |
|
| 422 | + tep_db_query("insert into ".TABLE_CONFIGURATION." |
|
| 423 | 423 | ( |
| 424 | 424 | configuration_title, |
| 425 | 425 | configuration_key, |
@@ -450,14 +450,14 @@ discard block |
||
| 450 | 450 | */ |
| 451 | 451 | private function installPagantisTables() |
| 452 | 452 | { |
| 453 | - $sql = "CREATE TABLE IF NOT EXISTS " . TABLE_PAGANTIS_LOG . " ( |
|
| 453 | + $sql = "CREATE TABLE IF NOT EXISTS ".TABLE_PAGANTIS_LOG." ( |
|
| 454 | 454 | id int NOT NULL AUTO_INCREMENT, |
| 455 | 455 | log text NOT NULL, |
| 456 | 456 | createdAt timestamp DEFAULT CURRENT_TIMESTAMP, |
| 457 | 457 | UNIQUE KEY id (id))"; |
| 458 | 458 | tep_db_query($sql); |
| 459 | 459 | |
| 460 | - $sql = "CREATE TABLE IF NOT EXISTS " . TABLE_PAGANTIS_CONFIG . " ( |
|
| 460 | + $sql = "CREATE TABLE IF NOT EXISTS ".TABLE_PAGANTIS_CONFIG." ( |
|
| 461 | 461 | id int NOT NULL AUTO_INCREMENT, |
| 462 | 462 | config varchar(60) NOT NULL, |
| 463 | 463 | value varchar(200) NOT NULL, |
@@ -465,10 +465,10 @@ discard block |
||
| 465 | 465 | tep_db_query($sql); |
| 466 | 466 | |
| 467 | 467 | // check if table has records |
| 468 | - $check_query = tep_db_query("select value from " . TABLE_PAGANTIS_CONFIG); |
|
| 468 | + $check_query = tep_db_query("select value from ".TABLE_PAGANTIS_CONFIG); |
|
| 469 | 469 | if (tep_db_num_rows($check_query) === 0) { |
| 470 | 470 | foreach ((array)$this->defaultConfigs as $configKey => $configValue) { |
| 471 | - $query = "INSERT INTO " . TABLE_PAGANTIS_CONFIG . " |
|
| 471 | + $query = "INSERT INTO ".TABLE_PAGANTIS_CONFIG." |
|
| 472 | 472 | ( |
| 473 | 473 | config, |
| 474 | 474 | value |
@@ -482,7 +482,7 @@ discard block |
||
| 482 | 482 | } |
| 483 | 483 | } |
| 484 | 484 | |
| 485 | - $sql = "CREATE TABLE IF NOT EXISTS " . TABLE_PAGANTIS_ORDERS . " ( |
|
| 485 | + $sql = "CREATE TABLE IF NOT EXISTS ".TABLE_PAGANTIS_ORDERS." ( |
|
| 486 | 486 | id int NOT NULL AUTO_INCREMENT, |
| 487 | 487 | os_order_id varchar(50), |
| 488 | 488 | os_order_reference varchar(50) NOT NULL, |
@@ -491,7 +491,7 @@ discard block |
||
| 491 | 491 | UNIQUE KEY id(id))"; |
| 492 | 492 | tep_db_query($sql); |
| 493 | 493 | |
| 494 | - $sql = "CREATE TABLE IF NOT EXISTS " . TABLE_PAGANTIS_CONCURRENCY . " ( |
|
| 494 | + $sql = "CREATE TABLE IF NOT EXISTS ".TABLE_PAGANTIS_CONCURRENCY." ( |
|
| 495 | 495 | id varchar(50) NOT NULL, |
| 496 | 496 | `timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, |
| 497 | 497 | UNIQUE KEY id(id))"; |
@@ -503,29 +503,29 @@ discard block |
||
| 503 | 503 | */ |
| 504 | 504 | public function remove() |
| 505 | 505 | { |
| 506 | - $checkTable = tep_db_query("SHOW TABLES LIKE '" . TABLE_PAGANTIS_LOG . "'"); |
|
| 506 | + $checkTable = tep_db_query("SHOW TABLES LIKE '".TABLE_PAGANTIS_LOG."'"); |
|
| 507 | 507 | if (tep_db_num_rows($checkTable) > 0) { |
| 508 | - tep_db_query("drop table " . TABLE_PAGANTIS_LOG); |
|
| 508 | + tep_db_query("drop table ".TABLE_PAGANTIS_LOG); |
|
| 509 | 509 | } |
| 510 | 510 | |
| 511 | - $checkTable = tep_db_query("SHOW TABLES LIKE '" . TABLE_PAGANTIS_CONFIG . "'"); |
|
| 511 | + $checkTable = tep_db_query("SHOW TABLES LIKE '".TABLE_PAGANTIS_CONFIG."'"); |
|
| 512 | 512 | if (tep_db_num_rows($checkTable) > 0) { |
| 513 | - tep_db_query("drop table " . TABLE_PAGANTIS_CONFIG); |
|
| 513 | + tep_db_query("drop table ".TABLE_PAGANTIS_CONFIG); |
|
| 514 | 514 | } |
| 515 | 515 | |
| 516 | - $checkTable = tep_db_query("SHOW TABLES LIKE '" . TABLE_PAGANTIS_ORDERS . "'"); |
|
| 516 | + $checkTable = tep_db_query("SHOW TABLES LIKE '".TABLE_PAGANTIS_ORDERS."'"); |
|
| 517 | 517 | if (tep_db_num_rows($checkTable) > 0) { |
| 518 | - tep_db_query("drop table " . TABLE_PAGANTIS_ORDERS); |
|
| 518 | + tep_db_query("drop table ".TABLE_PAGANTIS_ORDERS); |
|
| 519 | 519 | } |
| 520 | 520 | |
| 521 | - $checkTable = tep_db_query("SHOW TABLES LIKE '" . TABLE_PAGANTIS_CONCURRENCY . "'"); |
|
| 521 | + $checkTable = tep_db_query("SHOW TABLES LIKE '".TABLE_PAGANTIS_CONCURRENCY."'"); |
|
| 522 | 522 | if (tep_db_num_rows($checkTable) > 0) { |
| 523 | - tep_db_query("drop table " . TABLE_PAGANTIS_CONCURRENCY); |
|
| 523 | + tep_db_query("drop table ".TABLE_PAGANTIS_CONCURRENCY); |
|
| 524 | 524 | } |
| 525 | 525 | |
| 526 | - tep_db_query("DELETE FROM ". TABLE_CONFIGURATION ." where configuration_key in ('MODULE_PAYMENT_PAGANTIS_STATUS','MODULE_PAYMENT_PAGANTIS_PK','MODULE_PAYMENT_PAGANTIS_SK')"); |
|
| 526 | + tep_db_query("DELETE FROM ".TABLE_CONFIGURATION." where configuration_key in ('MODULE_PAYMENT_PAGANTIS_STATUS','MODULE_PAYMENT_PAGANTIS_PK','MODULE_PAYMENT_PAGANTIS_SK')"); |
|
| 527 | 527 | |
| 528 | - $query = "delete from " . TABLE_CONFIGURATION . " where configuration_key like '%_PAGANTIS_%'"; |
|
| 528 | + $query = "delete from ".TABLE_CONFIGURATION." where configuration_key like '%_PAGANTIS_%'"; |
|
| 529 | 529 | tep_db_query($query); |
| 530 | 530 | |
| 531 | 531 | $this->uninstallSimulator(); |
@@ -579,13 +579,13 @@ discard block |
||
| 579 | 579 | */ |
| 580 | 580 | private function insertRow($orderId, $pagantisOrderId, $globalVars) |
| 581 | 581 | { |
| 582 | - $query = "select * from " . TABLE_PAGANTIS_ORDERS . " where os_order_reference='$orderId'"; |
|
| 582 | + $query = "select * from ".TABLE_PAGANTIS_ORDERS." where os_order_reference='$orderId'"; |
|
| 583 | 583 | $resultsSelect = tep_db_query($query); |
| 584 | 584 | $countResults = tep_db_num_rows($resultsSelect); |
| 585 | 585 | if ($countResults == 0) { |
| 586 | - $query = "INSERT INTO " . TABLE_PAGANTIS_ORDERS . " |
|
| 586 | + $query = "INSERT INTO ".TABLE_PAGANTIS_ORDERS." |
|
| 587 | 587 | (os_order_reference, pagantis_order_id, globals) values ('$orderId', '$pagantisOrderId','$globalVars')"; |
| 588 | - } else { |
|
| 588 | + }else { |
|
| 589 | 589 | $query = "UPDATE ".TABLE_PAGANTIS_ORDERS." set pagantis_order_id='$pagantisOrderId' |
| 590 | 590 | where os_order_reference='$orderId'"; |
| 591 | 591 | } |
@@ -623,7 +623,7 @@ discard block |
||
| 623 | 623 | |
| 624 | 624 | if ($this->extraConfig['PAGANTIS_PROMOTION'] == '') { |
| 625 | 625 | $promotedProducts = array(); |
| 626 | - } else { |
|
| 626 | + }else { |
|
| 627 | 627 | $promotedProducts = array_values((array)unserialize($this->extraConfig['PAGANTIS_PROMOTION'])); |
| 628 | 628 | } |
| 629 | 629 | |
@@ -636,12 +636,12 @@ discard block |
||
| 636 | 636 | private function getDescription() |
| 637 | 637 | { |
| 638 | 638 | $descriptionCode = "<img src=\"images/icon_info.gif\" border=\"0\" alt=\"Info\" title=\"Info\"> <strong>Module version:</strong> $this->version<br/><br/>"; |
| 639 | - $descriptionCode.= "<img src=\"images/icon_info.gif\" border=\"0\"> <a href='https://developer.pagantis.com/' target=\"_blank\" style=\"text-decoration: underline; font-weight: bold;\">View Online Documentation</a><br/><br/>"; |
|
| 640 | - $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/>"; |
|
| 639 | + $descriptionCode .= "<img src=\"images/icon_info.gif\" border=\"0\"> <a href='https://developer.pagantis.com/' target=\"_blank\" style=\"text-decoration: underline; font-weight: bold;\">View Online Documentation</a><br/><br/>"; |
|
| 640 | + $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/>"; |
|
| 641 | 641 | if (MODULE_PAYMENT_PAGANTIS_STATUS == 'True') { |
| 642 | 642 | $pagantisPromotionUrl = $this->base_url.'/ext/modules/payment/pagantis/promotion.php'; |
| 643 | 643 | $linkDescription = "Si desea gestionar los productos promocionados pulse aquí"; |
| 644 | - $descriptionCode.= "<a href='$pagantisPromotionUrl'>$linkDescription</a>"; |
|
| 644 | + $descriptionCode .= "<a href='$pagantisPromotionUrl'>$linkDescription</a>"; |
|
| 645 | 645 | } |
| 646 | 646 | |
| 647 | 647 | return $descriptionCode; |
@@ -653,34 +653,34 @@ discard block |
||
| 653 | 653 | */ |
| 654 | 654 | private function installSimulator() |
| 655 | 655 | { |
| 656 | - $checkSimulator = tep_db_query("select configuration_key, configuration_value from " .TABLE_CONFIGURATION ." |
|
| 656 | + $checkSimulator = tep_db_query("select configuration_key, configuration_value from ".TABLE_CONFIGURATION." |
|
| 657 | 657 | where configuration_key like 'MODULE_HEADER_TAGS_INSTALLED' |
| 658 | 658 | and configuration_value like '%ht_pagantis.php%';"); |
| 659 | 659 | if (tep_db_num_rows($checkSimulator) > 0) { |
| 660 | 660 | return true; |
| 661 | 661 | } |
| 662 | 662 | |
| 663 | - $query = "UPDATE " . TABLE_CONFIGURATION . " set configuration_value = concat(configuration_value, ';ht_pagantis.php') |
|
| 663 | + $query = "UPDATE ".TABLE_CONFIGURATION." set configuration_value = concat(configuration_value, ';ht_pagantis.php') |
|
| 664 | 664 | where configuration_key like 'MODULE_HEADER_TAGS_INSTALLED'"; |
| 665 | 665 | tep_db_query($query); |
| 666 | 666 | |
| 667 | - 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())"); |
|
| 667 | + 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())"); |
|
| 668 | 668 | } |
| 669 | 669 | |
| 670 | 670 | private function uninstallSimulator() |
| 671 | 671 | { |
| 672 | - $checkSimulator = tep_db_query("select configuration_key, configuration_value from " .TABLE_CONFIGURATION ." |
|
| 672 | + $checkSimulator = tep_db_query("select configuration_key, configuration_value from ".TABLE_CONFIGURATION." |
|
| 673 | 673 | where configuration_key like 'MODULE_HEADER_TAGS_INSTALLED' |
| 674 | 674 | and configuration_value like '%ht_pagantis.php%';"); |
| 675 | 675 | if (tep_db_num_rows($checkSimulator) == 0) { |
| 676 | 676 | return true; |
| 677 | 677 | } |
| 678 | 678 | |
| 679 | - $query = "UPDATE " . TABLE_CONFIGURATION . " set configuration_value = REPLACE(configuration_value, ';ht_pagantis.php', '') |
|
| 679 | + $query = "UPDATE ".TABLE_CONFIGURATION." set configuration_value = REPLACE(configuration_value, ';ht_pagantis.php', '') |
|
| 680 | 680 | where configuration_key like 'MODULE_HEADER_TAGS_INSTALLED'"; |
| 681 | 681 | tep_db_query($query); |
| 682 | 682 | |
| 683 | - $query = "delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_HEADER_TAGS_PAGANTIS_STATUS'"; |
|
| 683 | + $query = "delete from ".TABLE_CONFIGURATION." where configuration_key = 'MODULE_HEADER_TAGS_PAGANTIS_STATUS'"; |
|
| 684 | 684 | tep_db_query($query); |
| 685 | 685 | } |
| 686 | 686 | } |
@@ -31,22 +31,22 @@ discard block |
||
| 31 | 31 | public $pgNotify; |
| 32 | 32 | |
| 33 | 33 | public $defaultConfigs = array('PAGANTIS_TITLE'=>'Instant Financing', |
| 34 | - 'PAGANTIS_SIMULATOR_DISPLAY_TYPE'=>'pgSDK.simulator.types.SIMPLE', |
|
| 35 | - 'PAGANTIS_SIMULATOR_DISPLAY_SKIN'=>'pgSDK.simulator.skins.BLUE', |
|
| 36 | - 'PAGANTIS_SIMULATOR_DISPLAY_POSITION'=>'hookDisplayProductButtons', |
|
| 37 | - 'PAGANTIS_SIMULATOR_START_INSTALLMENTS'=>3, |
|
| 38 | - 'PAGANTIS_SIMULATOR_MAX_INSTALLMENTS'=>12, |
|
| 39 | - 'PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR'=>'default', |
|
| 40 | - 'PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'=>'pgSDK.simulator.positions.INNER', |
|
| 41 | - 'PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR'=>'default', |
|
| 42 | - 'PAGANTIS_SIMULATOR_CSS_QUANTITY_SELECTOR'=>'default', |
|
| 43 | - 'PAGANTIS_FORM_DISPLAY_TYPE'=>0, |
|
| 44 | - 'PAGANTIS_DISPLAY_MIN_AMOUNT'=>1, |
|
| 45 | - 'PAGANTIS_URL_OK'=>'', |
|
| 46 | - 'PAGANTIS_URL_KO'=>'', |
|
| 47 | - 'PAGANTIS_TITLE_EXTRA' => 'Paga hasta en 12 cómodas cuotas con Paga+Tarde. Solicitud totalmente online y sin papeleos,¡y la respuesta es inmediata!', |
|
| 48 | - 'PAGANTIS_PROMOTION' => '', |
|
| 49 | - 'PAGANTIS_PROMOTED_PRODUCT_CODE' => '<p>PRODUCTO PROMOCIONADO CON PAGANTIS</p><img src="/ext/modules/payment/pagantis/img/sin_intereses.png"/>' |
|
| 34 | + 'PAGANTIS_SIMULATOR_DISPLAY_TYPE'=>'pgSDK.simulator.types.SIMPLE', |
|
| 35 | + 'PAGANTIS_SIMULATOR_DISPLAY_SKIN'=>'pgSDK.simulator.skins.BLUE', |
|
| 36 | + 'PAGANTIS_SIMULATOR_DISPLAY_POSITION'=>'hookDisplayProductButtons', |
|
| 37 | + 'PAGANTIS_SIMULATOR_START_INSTALLMENTS'=>3, |
|
| 38 | + 'PAGANTIS_SIMULATOR_MAX_INSTALLMENTS'=>12, |
|
| 39 | + 'PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR'=>'default', |
|
| 40 | + 'PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'=>'pgSDK.simulator.positions.INNER', |
|
| 41 | + 'PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR'=>'default', |
|
| 42 | + 'PAGANTIS_SIMULATOR_CSS_QUANTITY_SELECTOR'=>'default', |
|
| 43 | + 'PAGANTIS_FORM_DISPLAY_TYPE'=>0, |
|
| 44 | + 'PAGANTIS_DISPLAY_MIN_AMOUNT'=>1, |
|
| 45 | + 'PAGANTIS_URL_OK'=>'', |
|
| 46 | + 'PAGANTIS_URL_KO'=>'', |
|
| 47 | + 'PAGANTIS_TITLE_EXTRA' => 'Paga hasta en 12 cómodas cuotas con Paga+Tarde. Solicitud totalmente online y sin papeleos,¡y la respuesta es inmediata!', |
|
| 48 | + 'PAGANTIS_PROMOTION' => '', |
|
| 49 | + 'PAGANTIS_PROMOTED_PRODUCT_CODE' => '<p>PRODUCTO PROMOCIONADO CON PAGANTIS</p><img src="/ext/modules/payment/pagantis/img/sin_intereses.png"/>' |
|
| 50 | 50 | ); |
| 51 | 51 | |
| 52 | 52 | /** |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | try { |
| 158 | 158 | include_once('./ext/modules/payment/pagantis/vendor/autoload.php'); |
| 159 | 159 | global $order, $customer_id, $sendto, $billto, $cart, $languages_id, $currency, $currencies, $shipping, |
| 160 | - $payment, $comments, $customer_default_address_id, $cartID; |
|
| 160 | + $payment, $comments, $customer_default_address_id, $cartID; |
|
| 161 | 161 | $global_vars = array(); |
| 162 | 162 | $global_vars['customer_id'] = serialize($customer_id); |
| 163 | 163 | $global_vars['sendTo'] = serialize($sendto); |
@@ -3,12 +3,12 @@ discard block |
||
| 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 |
||
| 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 | } |
@@ -83,22 +83,22 @@ discard block |
||
| 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 |
||
| 133 | 133 | |
| 134 | 134 | if ($this->origin == 'notify') { |
| 135 | 135 | $jsonResponse->printResponse(); |
| 136 | - } else { |
|
| 136 | + }else { |
|
| 137 | 137 | return $jsonResponse; |
| 138 | 138 | } |
| 139 | 139 | } |
@@ -205,12 +205,12 @@ discard block |
||
| 205 | 205 | try { |
| 206 | 206 | $this->checkPagantisStatus(array('AUTHORIZED')); |
| 207 | 207 | } catch (\Exception $e) { |
| 208 | - if ($this->findOscommerceOrderId()!='') { |
|
| 208 | + if ($this->findOscommerceOrderId() != '') { |
|
| 209 | 209 | throw new AlreadyProcessedException(); |
| 210 | - } else { |
|
| 210 | + }else { |
|
| 211 | 211 | if ($this->pagantisOrder instanceof \Pagantis\OrdersApiClient\Model\Order) { |
| 212 | 212 | $status = $this->pagantisOrder->getStatus(); |
| 213 | - } else { |
|
| 213 | + }else { |
|
| 214 | 214 | $status = '-'; |
| 215 | 215 | } |
| 216 | 216 | throw new WrongStatusException($status); |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | { |
| 226 | 226 | global $order; |
| 227 | 227 | |
| 228 | - if ($order->info['order_status']!=='1') { |
|
| 228 | + if ($order->info['order_status'] !== '1') { |
|
| 229 | 229 | throw new AlreadyProcessedException(); |
| 230 | 230 | } |
| 231 | 231 | } |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | if ($orderId == null) { |
| 303 | 303 | $query = "delete from ".TABLE_PAGANTIS_CONCURRENCY." where timestamp<".(time() - 5); |
| 304 | 304 | tep_db_query($query); |
| 305 | - } elseif ($orderId!='') { |
|
| 305 | + } elseif ($orderId != '') { |
|
| 306 | 306 | $query = "delete from ".TABLE_PAGANTIS_CONCURRENCY." where id='$orderId'"; |
| 307 | 307 | tep_db_query($query); |
| 308 | 308 | } |
@@ -354,12 +354,12 @@ discard block |
||
| 354 | 354 | if (!$payed) { |
| 355 | 355 | if ($this->pagantisOrder instanceof \Pagantis\OrdersApiClient\Model\Order) { |
| 356 | 356 | $status = $this->pagantisOrder->getStatus(); |
| 357 | - } else { |
|
| 357 | + }else { |
|
| 358 | 358 | $status = '-'; |
| 359 | 359 | } |
| 360 | 360 | throw new WrongStatusException($status); |
| 361 | 361 | } |
| 362 | - } else { |
|
| 362 | + }else { |
|
| 363 | 363 | throw new OrderNotFoundException(); |
| 364 | 364 | } |
| 365 | 365 | } |
@@ -392,7 +392,7 @@ discard block |
||
| 392 | 392 | tep_db_query($query); |
| 393 | 393 | |
| 394 | 394 | $comment = "Pagantis id=$this->pagantisOrderId/Via=".ucfirst($this->origin); |
| 395 | - $query = "insert into ".TABLE_ORDERS_STATUS_HISTORY ."(comments, orders_id, orders_status_id, customer_notified, date_added) values |
|
| 395 | + $query = "insert into ".TABLE_ORDERS_STATUS_HISTORY."(comments, orders_id, orders_status_id, customer_notified, date_added) values |
|
| 396 | 396 | ('$comment', ".$insert_id.", '2', -1, now() )"; |
| 397 | 397 | tep_db_query($query); |
| 398 | 398 | |
@@ -417,7 +417,7 @@ discard block |
||
| 417 | 417 | private function insertLog($exception) |
| 418 | 418 | { |
| 419 | 419 | if ($exception instanceof \Exception) { |
| 420 | - $logEntry= new LogEntry(); |
|
| 420 | + $logEntry = new LogEntry(); |
|
| 421 | 421 | $logEntryJson = $logEntry->error($exception)->toJson(); |
| 422 | 422 | |
| 423 | 423 | $query = "insert into ".TABLE_PAGANTIS_LOG."(log) values ('$logEntryJson')"; |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | $this->description = MODULE_HEADER_TAGS_PAGANTIS_DESCRIPTION; |
| 29 | 29 | $this->sort_order = 0; |
| 30 | 30 | |
| 31 | - if ( defined('MODULE_HEADER_TAGS_PAGANTIS_STATUS') ) { |
|
| 31 | + if (defined('MODULE_HEADER_TAGS_PAGANTIS_STATUS')) { |
|
| 32 | 32 | $this->enabled = (MODULE_HEADER_TAGS_PAGANTIS_STATUS == 'True'); |
| 33 | 33 | } |
| 34 | 34 | |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | private function getConfig($config = '') |
| 63 | 63 | { |
| 64 | - $query = "select configuration_value from ".TABLE_CONFIGURATION . " where configuration_key = '" . $config . "'"; |
|
| 64 | + $query = "select configuration_value from ".TABLE_CONFIGURATION." where configuration_key = '".$config."'"; |
|
| 65 | 65 | $result = tep_db_query($query); |
| 66 | 66 | $resultArray = tep_db_fetch_array($result); |
| 67 | 67 | return $resultArray['configuration_value']; |
@@ -80,66 +80,66 @@ discard block |
||
| 80 | 80 | $this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_SKIN'] = 'pmtSDK.simulator.skins.BLUE'; |
| 81 | 81 | $simulatorCode = 'pmtSDK'; |
| 82 | 82 | } |
| 83 | - echo "<script src='".$this->sdkFile."'></script>". PHP_EOL; |
|
| 84 | - echo '<script>'. PHP_EOL; |
|
| 85 | - echo ' function loadSimulator()'. PHP_EOL; |
|
| 86 | - echo ' {'. PHP_EOL; |
|
| 87 | - echo ' if (typeof '.$simulatorCode.' != \'undefined\') {'. PHP_EOL; |
|
| 88 | - echo ' var positionSelector = \'' . $this->extraConfig['PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR']. '\';'. PHP_EOL; |
|
| 89 | - echo ' var priceSelector = \'' . $this->extraConfig['PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR']. '\';'. PHP_EOL; |
|
| 90 | - echo ' var quantitySelector = \'' . $this->extraConfig['PAGANTIS_SIMULATOR_CSS_QUANTITY_SELECTOR']. '\';'. PHP_EOL; |
|
| 91 | - |
|
| 92 | - echo ' if (positionSelector === \'default\') {'. PHP_EOL; |
|
| 93 | - echo ' positionSelector = \'.buttonSet\''. PHP_EOL; |
|
| 94 | - echo ' }'. PHP_EOL; |
|
| 95 | - |
|
| 96 | - echo ' if (priceSelector === \'default\') {'. PHP_EOL; |
|
| 97 | - echo ' priceSelector = \'#bodyContent>form>div>h1\''. PHP_EOL; |
|
| 98 | - echo ' }'. PHP_EOL; |
|
| 99 | - |
|
| 100 | - echo ' '.$simulatorCode.'.product_simulator = {};'. PHP_EOL; |
|
| 101 | - echo ' '.$simulatorCode.'.product_simulator.id = \'product-simulator\';'. PHP_EOL; |
|
| 102 | - echo ' '.$simulatorCode.'.product_simulator.publicKey = \'' . $this->pk . '\';'. PHP_EOL; |
|
| 103 | - echo ' '.$simulatorCode.'.product_simulator.selector = positionSelector;'. PHP_EOL; |
|
| 104 | - echo ' '.$simulatorCode.'.product_simulator.numInstalments = \'' . $this->extraConfig['PAGANTIS_SIMULATOR_START_INSTALLMENTS'] . '\';'. PHP_EOL; |
|
| 105 | - echo ' '.$simulatorCode.'.product_simulator.type = ' . $this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_TYPE'] . ';'. PHP_EOL; |
|
| 106 | - echo ' '.$simulatorCode.'.product_simulator.skin = ' . $this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_SKIN'] . ';'. PHP_EOL; |
|
| 107 | - echo ' '.$simulatorCode.'.product_simulator.position = ' . $this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'] . ';'. PHP_EOL; |
|
| 108 | - echo ' '.$simulatorCode.'.product_simulator.itemAmountSelector = priceSelector;'. PHP_EOL; |
|
| 109 | - |
|
| 110 | - echo ' '.$simulatorCode.'.simulator.init('.$simulatorCode.'.product_simulator);'. PHP_EOL; |
|
| 111 | - echo ' clearInterval(window.PSSimulatorId);'. PHP_EOL; |
|
| 112 | - echo ' return true;'. PHP_EOL; |
|
| 113 | - echo ' }'. PHP_EOL; |
|
| 114 | - echo ' return false;'. PHP_EOL; |
|
| 115 | - echo ' }'. PHP_EOL; |
|
| 116 | - echo ' window.PSSimulatorId = setInterval(function () {'. PHP_EOL; |
|
| 117 | - echo ' loadSimulator();'. PHP_EOL; |
|
| 118 | - echo ' }, 2000);'. PHP_EOL; |
|
| 119 | - echo '</script>'. PHP_EOL; |
|
| 83 | + echo "<script src='".$this->sdkFile."'></script>".PHP_EOL; |
|
| 84 | + echo '<script>'.PHP_EOL; |
|
| 85 | + echo ' function loadSimulator()'.PHP_EOL; |
|
| 86 | + echo ' {'.PHP_EOL; |
|
| 87 | + echo ' if (typeof '.$simulatorCode.' != \'undefined\') {'.PHP_EOL; |
|
| 88 | + echo ' var positionSelector = \''.$this->extraConfig['PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR'].'\';'.PHP_EOL; |
|
| 89 | + echo ' var priceSelector = \''.$this->extraConfig['PAGANTIS_SIMULATOR_CSS_PRICE_SELECTOR'].'\';'.PHP_EOL; |
|
| 90 | + echo ' var quantitySelector = \''.$this->extraConfig['PAGANTIS_SIMULATOR_CSS_QUANTITY_SELECTOR'].'\';'.PHP_EOL; |
|
| 91 | + |
|
| 92 | + echo ' if (positionSelector === \'default\') {'.PHP_EOL; |
|
| 93 | + echo ' positionSelector = \'.buttonSet\''.PHP_EOL; |
|
| 94 | + echo ' }'.PHP_EOL; |
|
| 95 | + |
|
| 96 | + echo ' if (priceSelector === \'default\') {'.PHP_EOL; |
|
| 97 | + echo ' priceSelector = \'#bodyContent>form>div>h1\''.PHP_EOL; |
|
| 98 | + echo ' }'.PHP_EOL; |
|
| 99 | + |
|
| 100 | + echo ' '.$simulatorCode.'.product_simulator = {};'.PHP_EOL; |
|
| 101 | + echo ' '.$simulatorCode.'.product_simulator.id = \'product-simulator\';'.PHP_EOL; |
|
| 102 | + echo ' '.$simulatorCode.'.product_simulator.publicKey = \''.$this->pk.'\';'.PHP_EOL; |
|
| 103 | + echo ' '.$simulatorCode.'.product_simulator.selector = positionSelector;'.PHP_EOL; |
|
| 104 | + echo ' '.$simulatorCode.'.product_simulator.numInstalments = \''.$this->extraConfig['PAGANTIS_SIMULATOR_START_INSTALLMENTS'].'\';'.PHP_EOL; |
|
| 105 | + echo ' '.$simulatorCode.'.product_simulator.type = '.$this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_TYPE'].';'.PHP_EOL; |
|
| 106 | + echo ' '.$simulatorCode.'.product_simulator.skin = '.$this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_SKIN'].';'.PHP_EOL; |
|
| 107 | + echo ' '.$simulatorCode.'.product_simulator.position = '.$this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'].';'.PHP_EOL; |
|
| 108 | + echo ' '.$simulatorCode.'.product_simulator.itemAmountSelector = priceSelector;'.PHP_EOL; |
|
| 109 | + |
|
| 110 | + echo ' '.$simulatorCode.'.simulator.init('.$simulatorCode.'.product_simulator);'.PHP_EOL; |
|
| 111 | + echo ' clearInterval(window.PSSimulatorId);'.PHP_EOL; |
|
| 112 | + echo ' return true;'.PHP_EOL; |
|
| 113 | + echo ' }'.PHP_EOL; |
|
| 114 | + echo ' return false;'.PHP_EOL; |
|
| 115 | + echo ' }'.PHP_EOL; |
|
| 116 | + echo ' window.PSSimulatorId = setInterval(function () {'.PHP_EOL; |
|
| 117 | + echo ' loadSimulator();'.PHP_EOL; |
|
| 118 | + echo ' }, 2000);'.PHP_EOL; |
|
| 119 | + echo '</script>'.PHP_EOL; |
|
| 120 | 120 | |
| 121 | 121 | if ($this->isPromoted($GLOBALS["HTTP_GET_VARS"]["products_id"])) { |
| 122 | 122 | echo "<div id='promotedText' style='display:none'><br/>".$this->extraConfig['PAGANTIS_PROMOTED_PRODUCT_CODE']."</div>"; |
| 123 | - echo '<script>'. PHP_EOL; |
|
| 124 | - echo ' function loadPromoted()'. PHP_EOL; |
|
| 125 | - echo ' {'. PHP_EOL; |
|
| 126 | - echo 'var positionSelector = \'' . $this->extraConfig['PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR']. '\';'. PHP_EOL; |
|
| 127 | - echo 'if (positionSelector === \'default\') {'. PHP_EOL; |
|
| 128 | - echo 'positionSelector = \'.buttonSet\''. PHP_EOL; |
|
| 129 | - echo '}'. PHP_EOL; |
|
| 123 | + echo '<script>'.PHP_EOL; |
|
| 124 | + echo ' function loadPromoted()'.PHP_EOL; |
|
| 125 | + echo ' {'.PHP_EOL; |
|
| 126 | + echo 'var positionSelector = \''.$this->extraConfig['PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR'].'\';'.PHP_EOL; |
|
| 127 | + echo 'if (positionSelector === \'default\') {'.PHP_EOL; |
|
| 128 | + echo 'positionSelector = \'.buttonSet\''.PHP_EOL; |
|
| 129 | + echo '}'.PHP_EOL; |
|
| 130 | 130 | echo 'var docFather = document.querySelector(positionSelector);'.PHP_EOL; |
| 131 | - echo 'if (typeof docFather != \'undefined\') {'. PHP_EOL; |
|
| 131 | + echo 'if (typeof docFather != \'undefined\') {'.PHP_EOL; |
|
| 132 | 132 | echo 'var promotedNode = document.getElementById("promotedText");'.PHP_EOL; |
| 133 | 133 | echo 'docFather.appendChild(promotedNode);'.PHP_EOL; |
| 134 | - echo 'promotedNode.style.display=""' . PHP_EOL; |
|
| 135 | - echo ' return true;'. PHP_EOL; |
|
| 136 | - echo ' }'. PHP_EOL; |
|
| 137 | - echo ' return false;'. PHP_EOL; |
|
| 138 | - echo ' }'. PHP_EOL; |
|
| 139 | - echo ' window.PSPromotedId = setInterval(function () {'. PHP_EOL; |
|
| 140 | - echo ' loadPromoted();'. PHP_EOL; |
|
| 141 | - echo ' }, 2000);'. PHP_EOL; |
|
| 142 | - echo '</script>'. PHP_EOL; |
|
| 134 | + echo 'promotedNode.style.display=""'.PHP_EOL; |
|
| 135 | + echo ' return true;'.PHP_EOL; |
|
| 136 | + echo ' }'.PHP_EOL; |
|
| 137 | + echo ' return false;'.PHP_EOL; |
|
| 138 | + echo ' }'.PHP_EOL; |
|
| 139 | + echo ' window.PSPromotedId = setInterval(function () {'.PHP_EOL; |
|
| 140 | + echo ' loadPromoted();'.PHP_EOL; |
|
| 141 | + echo ' }, 2000);'.PHP_EOL; |
|
| 142 | + echo '</script>'.PHP_EOL; |
|
| 143 | 143 | } |
| 144 | 144 | } |
| 145 | 145 | } |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | * install |
| 163 | 163 | */ |
| 164 | 164 | function install() { |
| 165 | - 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())"); |
|
| 165 | + 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())"); |
|
| 166 | 166 | |
| 167 | 167 | } |
| 168 | 168 | |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | * remove |
| 171 | 171 | */ |
| 172 | 172 | function remove() { |
| 173 | - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); |
|
| 173 | + tep_db_query("delete from ".TABLE_CONFIGURATION." where configuration_key in ('".implode("', '", $this->keys())."')"); |
|
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | /** |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | |
| 193 | 193 | if ($this->extraConfig['PAGANTIS_PROMOTION'] == '') { |
| 194 | 194 | $promotedProducts = array(); |
| 195 | - } else { |
|
| 195 | + }else { |
|
| 196 | 196 | $promotedProducts = array_values((array)unserialize($this->extraConfig['PAGANTIS_PROMOTION'])); |
| 197 | 197 | } |
| 198 | 198 | |