-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #273 from Zasilkovna/PES-1487_button_hiding_fix
PES-1487: widget button display fix
- Loading branch information
Showing
5 changed files
with
62 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[Návod v češtině](#modul-pro-prestashop-17) | ||
|
||
# Module for PrestaShop 1.7 | ||
# Module for PrestaShop 1.7, PrestaShop 8 | ||
|
||
### Download link | ||
[Download the latest version](https://github.com/Zasilkovna/prestashop/releases/latest) | ||
|
@@ -75,7 +75,7 @@ In the **Orders** tab you will find a list of all orders for which the Packeta s | |
- english | ||
|
||
### Supported versions | ||
- PrestaShop version 1.7.x. | ||
- PrestaShop 1.7.x., PrestaShop 8 | ||
- If you have problems using the module, please contact us at [[email protected]](mailto:[email protected]). | ||
|
||
### Provided functions | ||
|
@@ -102,12 +102,12 @@ Packeta module may not work with another OPC module. | |
| Module version | Branch | PHP version | | ||
|----------------|----------|-------------| | ||
| `>= 2.1.18` | `master` | 5.6 - 8.2 | | ||
| `>= 3.0` | `v3.0.0` | 5.6 - 8.2 | | ||
| `>= 3.0` | `v3` | 5.6 - 8.2 | | ||
|
||
### Further module limitations | ||
- Module does not currently support multistore. | ||
|
||
# Modul pro PrestaShop 1.7 | ||
# Modul pro PrestaShop 1.7, PrestaShop 8 | ||
|
||
### Stažení modulu | ||
[Aktuální verze (Stáhnout »)](https://github.com/Zasilkovna/prestashop/releases/latest) | ||
|
@@ -185,7 +185,7 @@ V záložce **objednávky** naleznete seznam všech objednávek u kterých byla | |
- angličtina | ||
|
||
### Podporovaná verze | ||
- PrestaShop verze 1.7.x. | ||
- PrestaShop 1.7.x., PrestaShop 8 | ||
- Při problému s použitím modulu nás kontaktujte na adrese [[email protected]](mailto:[email protected]). | ||
|
||
### Poskytované funkce | ||
|
@@ -211,7 +211,7 @@ Modul Zásilkovny nemusí být s jiným OPC modulem funkční. | |
| Verze modulu | Větev | PHP verze | | ||
|--------------|----------|-----------| | ||
| `>= 2.1.18` | `master` | 5.6 - 8.2 | | ||
| `>= 3.0` | `v3.0.0` | 5.6 - 8.2 | | ||
| `>= 3.0` | `v3` | 5.6 - 8.2 | | ||
|
||
### Další omezení modulu | ||
- Modul v současné době nepodporuje multistore. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
namespace Packetery\Module; | ||
|
||
class Helper | ||
{ | ||
|
||
/** | ||
* @param mixed $value | ||
* | ||
* @return bool | ||
*/ | ||
private static function isCastableToInt($value) | ||
{ | ||
if (is_int($value)) { | ||
return true; | ||
} | ||
if (is_string($value) && strlen((string)(float)$value) !== strlen($value)) { | ||
return false; | ||
} | ||
if (is_float($value) || is_string($value)) { | ||
if ($value <= PHP_INT_MAX && $value >= -PHP_INT_MAX) { | ||
return (int)$value == $value; | ||
} | ||
|
||
return false; | ||
} | ||
|
||
return false; | ||
} | ||
|
||
/** | ||
* @param array $array | ||
* | ||
* @return array | ||
*/ | ||
public static function typeCastableArrayItemsAsInts(array $array) | ||
{ | ||
foreach ($array as $key => $value) { | ||
if (self::isCastableToInt($value)) { | ||
$array[$key] = (int)$value; | ||
} | ||
} | ||
|
||
return $array; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters