mirror of
https://github.com/retailcrm/opencart-module.git
synced 2024-11-24 06:06:06 +03:00
ref #73045 Fixed the transfer of the weight of offers
This commit is contained in:
commit
22a9c2d819
@ -1,3 +1,6 @@
|
|||||||
|
## v4.1.11
|
||||||
|
* Fixed the transfer of the weight offers
|
||||||
|
|
||||||
## v4.1.10
|
## v4.1.10
|
||||||
* Types of deliveries and payments are displayed only active status and available stores
|
* Types of deliveries and payments are displayed only active status and available stores
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ class ModelExtensionRetailcrmIcml extends Model
|
|||||||
{
|
{
|
||||||
parent::__construct($registry);
|
parent::__construct($registry);
|
||||||
$this->load->library('retailcrm/retailcrm');
|
$this->load->library('retailcrm/retailcrm');
|
||||||
|
$this->load->model('localisation/weight_class');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function generateICML()
|
public function generateICML()
|
||||||
@ -107,6 +108,12 @@ class ModelExtensionRetailcrmIcml extends Model
|
|||||||
$defaultCurrency = $this->getDefaultCurrency();
|
$defaultCurrency = $this->getDefaultCurrency();
|
||||||
$settingLenght = $this->retailcrm->getLenghtForIcml();
|
$settingLenght = $this->retailcrm->getLenghtForIcml();
|
||||||
$leghtsArray = $this->model_localisation_length_class->getLengthClasses();
|
$leghtsArray = $this->model_localisation_length_class->getLengthClasses();
|
||||||
|
$weightClassesMas = $this->model_localisation_weight_class->getWeightClasses();
|
||||||
|
$weightClasses = [];
|
||||||
|
|
||||||
|
foreach ($weightClassesMas as $weightClass) {
|
||||||
|
$weightClasses[$weightClass['weight_class_id']]['value'] = $weightClass['value'];
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($leghtsArray as $lenght) {
|
foreach ($leghtsArray as $lenght) {
|
||||||
if ($lenght['value'] == 1) {
|
if ($lenght['value'] == 1) {
|
||||||
@ -309,18 +316,18 @@ class ModelExtensionRetailcrmIcml extends Model
|
|||||||
$e->appendChild($sku);
|
$e->appendChild($sku);
|
||||||
}
|
}
|
||||||
if ($product['weight'] != '') {
|
if ($product['weight'] != '') {
|
||||||
$weight = $this->dd->createElement('param');
|
$weight = $this->dd->createElement('weight');
|
||||||
$weight->setAttribute('code', 'weight');
|
$coeffWeight = 1;
|
||||||
$weight->setAttribute('name', $this->language->get('weight'));
|
|
||||||
if (!empty($optionsValues['weight'])) {
|
if (!empty($weightClasses[$product['weight_class_id']]['value'])) {
|
||||||
$weightValue = round($product['weight'] + $optionsValues['weight'], 3);
|
$coeffWeight = $weightClasses[$product['weight_class_id']]['value'];
|
||||||
} else {
|
|
||||||
$weightValue = round($product['weight'], 3);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($product['weight_class'])) {
|
$weightValue = !empty($optionsValues['weight'])
|
||||||
$weightValue = $weightValue . ' ' . $product['weight_class'];
|
? $product['weight'] + $optionsValues['weight']
|
||||||
}
|
: $product['weight']
|
||||||
|
;
|
||||||
|
$weightValue = round($weightValue / $coeffWeight, 6);
|
||||||
|
|
||||||
$weight->appendChild($this->dd->createTextNode($weightValue));
|
$weight->appendChild($this->dd->createTextNode($weightValue));
|
||||||
$e->appendChild($weight);
|
$e->appendChild($weight);
|
||||||
|
Loading…
Reference in New Issue
Block a user