diff --git a/CHANGELOG.md b/CHANGELOG.md index 507b5c6..fefe311 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ ## v4.1.11 -* Fixed the transfer of the weight of trade offers +* Fixed the transfer of the weight offers ## v4.1.10 * Types of deliveries and payments are displayed only active status and available stores diff --git a/src/upload/admin/model/extension/retailcrm/icml.php b/src/upload/admin/model/extension/retailcrm/icml.php index f668874..4fd07ca 100644 --- a/src/upload/admin/model/extension/retailcrm/icml.php +++ b/src/upload/admin/model/extension/retailcrm/icml.php @@ -319,21 +319,15 @@ class ModelExtensionRetailcrmIcml extends Model $weight = $this->dd->createElement('weight'); $coeffWeight = 1; - if ( - !empty($weightClasses[$product['weight_class_id']]['value']) - && $weightClasses[$product['weight_class_id']]['value'] !== 0 - ) { + if (!empty($weightClasses[$product['weight_class_id']]['value'])) { $coeffWeight = $weightClasses[$product['weight_class_id']]['value']; } - if (!empty($optionsValues['weight'])) { - $weightValue = round( - ($product['weight'] + $optionsValues['weight'])/$coeffWeight, - 6 - ); - } else { - $weightValue = round($product['weight']/$coeffWeight, 6); - } + $weightValue = !empty($optionsValues['weight']) + ? $product['weight'] + $optionsValues['weight'] + : $product['weight'] + ; + $weightValue = round($weightValue / $coeffWeight, 6); $weight->appendChild($this->dd->createTextNode($weightValue)); $e->appendChild($weight);