Skip to content

Commit

Permalink
Add compatibility with PHP 7.4
Browse files Browse the repository at this point in the history
CS-5145
  • Loading branch information
MarijaIv committed Feb 29, 2024
1 parent e472b23 commit 2509ca5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
3 changes: 1 addition & 2 deletions Services/BusinessLogic/Utility/SeQuraTranslationProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ public function __construct(Reader $moduleDirReader, Csv $csv, Session $session)
*/
public function translate(string $text, ...$arguments): Phrase
{
$locale = $this->session->getUser() ?
$this->session->getUser()->getInterfaceLocale() : null;
$locale = ($user = $this->session->getUser()) ? $user->getInterfaceLocale(): null;
if ($locale && !self::$englishTranslation) {
$filePath = $this->moduleDirReader->getModuleDir('i18n', 'Sequra_Core') . '/' . $locale . '.csv';
if (!file_exists($filePath)) {
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
],
"minimum-stability": "stable",
"require": {
"php": ">=7.2",
"php": ">=7.4",
"sequra/integration-core": "v1.0.11",
"ext-json": "*"
},
Expand Down
4 changes: 2 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@ define([
},

loadSeQuraScript: function () {
if (!window.checkoutConfig.payment.sequra_payment.widget_settings.hasOwnProperty('merchant')) {
return;
}

if (typeof Sequra === "undefined") {
let products = [];
window.checkoutConfig.payment.sequra_payment.widget_settings.products.forEach((product) => {
Expand Down

0 comments on commit 2509ca5

Please sign in to comment.