mirror of
https://github.com/retailcrm/opencart-module.git
synced 2024-11-23 13:46:07 +03:00
Minor improvements
* Fix country iso code * Fix ICML weight generation * Update phpcs rules to php >= 7.3
This commit is contained in:
parent
463485509e
commit
6790cf7b0e
2
Makefile
2
Makefile
@ -46,4 +46,4 @@ phpcs-config:
|
||||
bin/phpcs --config-set installed_paths vendor/phpcompatibility/php-compatibility
|
||||
|
||||
phpcomp: phpcs-config
|
||||
@bin/phpcs -s -p ./src --standard=PHPCompatibility --runtime-set testVersion 5.4-7.3
|
||||
@bin/phpcs -s -p ./src --standard=PHPCompatibility --runtime-set testVersion 7.3-7.4
|
||||
|
@ -312,7 +312,11 @@ class ModelExtensionRetailcrmIcml extends Model
|
||||
$weight = $this->dd->createElement('param');
|
||||
$weight->setAttribute('code', 'weight');
|
||||
$weight->setAttribute('name', $this->language->get('weight'));
|
||||
$weightValue = round($product['weight'] + $optionsValues['weight'], 3);
|
||||
if (!empty($optionsValues['weight'])) {
|
||||
$weightValue = round($product['weight'] + $optionsValues['weight'], 3);
|
||||
} else {
|
||||
$weightValue = round($product['weight'], 3);
|
||||
}
|
||||
|
||||
if (isset($product['weight_class'])) {
|
||||
$weightValue = $weightValue . ' ' . $product['weight_class'];
|
||||
|
@ -77,8 +77,8 @@ class ControllerApiRetailcrm extends Controller
|
||||
$address = array(
|
||||
'country_id' => $country_id,
|
||||
'zone_id' => $zone['zone_id'],
|
||||
'iso_code_2' => $country['iso_code_2'],
|
||||
'iso_code_3' => $country['iso_code_3'],
|
||||
'iso_code_2' => $country['iso_code_2'] ?? '',
|
||||
'iso_code_3' => $country['iso_code_3'] ?? '',
|
||||
'zone_code' => $zone['code'],
|
||||
'postcode' => '',
|
||||
'city' => ''
|
||||
|
@ -31,7 +31,7 @@ class OpencartApiClient {
|
||||
|
||||
$cookies = array();
|
||||
foreach ($cookieFile as $line) {
|
||||
if (empty($line) OR $line{0} == '#') {
|
||||
if (empty($line) OR $line[0] == '#') {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user