Skip to content

Commit 425de02

Browse files
committed
[fix] repair some errors for CE Phoenix
- added verification for HTTP_X_REQUESTED_WITH existence - removed unnecessary "language.php" inclusion (it is included /instantiated in includes\classes\application.php) - changed .htaccess modification from "Allow from all" to "Require all granted" for paylike.php file to be accesible on ajax.
1 parent 52af44b commit 425de02

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

README_Phoenix.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Released under the GPL V3 license: https://opensource.org/licenses/GPL-3.0
77

88
## Supported osCommerce versions
99

10-
*The plugin has been tested with osCommerce CE Phoenix up to v1.0.7.10
10+
*The plugin has been tested with osCommerce CE Phoenix up to v1.0.7.18
1111

1212
## Installation
1313

@@ -27,7 +27,7 @@ Released under the GPL V3 license: https://opensource.org/licenses/GPL-3.0
2727
6. In: `includes/.htaccess` add:
2828
```
2929
<FilesMatch "paylike.php">
30-
Allow from all
30+
Require all granted
3131
</FilesMatch>
3232
3333
```
@@ -66,7 +66,7 @@ Released under the GPL V3 license: https://opensource.org/licenses/GPL-3.0
6666
```
6767
Before ```<div class="row no-gutters">``` line.
6868
69-
8. Install the Paylike module from modules -> payment in the admin
69+
8. Install the Paylike module from modules -> payment in the admin
7070
9. Insert the app key and your public key in the settings and enable the plugin
7171
7272
## Updating settings

upload_ce_phoenix/includes/modules/paylike.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
if ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' && isset($_POST['action'])) {
2+
if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' && isset($_POST['action'])) {
33
chdir('../../');
44
$rootPath = dirname(dirname(dirname($_SERVER['SCRIPT_FILENAME'])));
55
require $rootPath . '/includes/application_top.php';
@@ -10,7 +10,6 @@
1010
define('MODULE_PAYMENT_PAYLIKE_VERSION', '0.4');
1111

1212
if (isset($_POST['action']) && $_POST['action'] === 'getOrderTotalsData') {
13-
include($rootPath.'/includes/classes/language.php');
1413
$order = new order();
1514

1615
/** Load paylike currencies file with some needed currencies attributes. */
@@ -39,7 +38,7 @@
3938
'test_mode'=>MODULE_PAYMENT_PAYLIKE_TRANSACTION_MODE,
4039
'store_name'=>$_SESSION['PAYLIKE_TITLE']?:STORE_NAME,
4140
'currency'=>$order->info['currency'],
42-
'amount'=>(int)number_format($order->info['total']*$order->info['currency_value'], 2, '.', '')*100,
41+
'amount'=>number_format($order->info['total']*$order->info['currency_value'], 2, '.', '')*100,
4342
'exponent'=>get_paylike_currency($order->info['currency'])['exponent'],
4443
'locale'=>key($current_lang),
4544
'custom'=>[

0 commit comments

Comments
 (0)