Skip to content

Commit

Permalink
Merge pull request #106 from mijora/Develop
Browse files Browse the repository at this point in the history
Develop from v2.2.0
  • Loading branch information
markakk authored Nov 22, 2024
2 parents abbf4c7 + 4035475 commit baffaf6
Show file tree
Hide file tree
Showing 34 changed files with 1,255 additions and 436 deletions.
8 changes: 8 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
= 2.2.1 =
# Fixed
- Fixed "Omniva orders" page error, when international carriers had never been created before
- Removed the use of the str_contains function, since this function only appeared in PHP 8.0

# Updated
- API library to 1.3.1

= 2.2.0 =
# Fixed
- Fixed adding a new DB column in the Upgrade function of the version 2.1.0
Expand Down
6 changes: 3 additions & 3 deletions classes/OmnivaApiInternational.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,11 @@ public static function isPackageAvailableForItems( $package_key, $country_code,
/**************************** API related module functions ****************************/
public static function getPackageKeyFromMethodKey( $method_key )
{
if (str_contains($method_key, 'omnivalt_')) {
if (strpos($method_key, 'omnivalt_') !== false) {
$method_key = str_replace('omnivalt_', '', $method_key);
}

if (str_contains($method_key, 'int_')) {
if (strpos($method_key, 'int_') !== false) {
$method_key = str_replace('int_', '', $method_key);
}

Expand All @@ -194,7 +194,7 @@ public static function isOmnivaMethodAllowed( $method_key, $receiver_country )

public static function isInternationalMethod( $method_key )
{
if (!str_contains($method_key, 'int_')) {
if (strpos($method_key, 'int_') === false) {
return false;
}

Expand Down
43 changes: 29 additions & 14 deletions composer.lock

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

7 changes: 5 additions & 2 deletions omnivaltshipping.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function __construct()
{
$this->name = 'omnivaltshipping';
$this->tab = 'shipping_logistics';
$this->version = '2.2.0';
$this->version = '2.2.1';
$this->author = 'Mijora';
$this->need_instance = 0;
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
Expand Down Expand Up @@ -1442,7 +1442,10 @@ public static function getCarrierIds($carriers = [])
$carriers = count($carriers) > 0 ? $carriers : array_keys(OmnivaCarrier::getAllMethods());
$ref = [];
foreach ($carriers as $value) {
$ref[] = OmnivaCarrier::getReference($value);
$carrier_ref_id = OmnivaCarrier::getReference($value);
if ($carrier_ref_id) {
$ref[] = OmnivaCarrier::getReference($value);
}
}
$data = [];
if ($ref) {
Expand Down
10 changes: 0 additions & 10 deletions vendor/.htaccess

This file was deleted.

20 changes: 19 additions & 1 deletion vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@

// autoload.php @generated by Composer

if (PHP_VERSION_ID < 50600) {
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
fwrite(STDERR, $err);
} elseif (!headers_sent()) {
echo $err;
}
}
trigger_error(
$err,
E_USER_ERROR
);
}

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInitbd577bb8225a5ed1df8c4c014562ed4d::getLoader();
return ComposerAutoloaderInitb781158b062661163502a2e8203f16b7::getLoader();
Loading

0 comments on commit baffaf6

Please sign in to comment.