Skip to content

Commit

Permalink
Fix all attributes was loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
lopes-vincent authored Mar 8, 2021
1 parent 842e5f6 commit 9565b03
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Model/Api/ProductSaleElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ public function createFromTheliaModel($theliaModel, $locale = null)
$this->attributes = array_map(
function (AttributeCombination $attributeCombination) use ($modelFactory){
$propelAttribute = $attributeCombination->getAttribute();
$attributeAvBackup = $propelAttribute->getAttributeAvs();

// Temporary set only pse attribute av to build good attribute av list
$propelAttribute->setAttributeAvs((new Collection()));
Expand All @@ -167,7 +166,7 @@ function (AttributeCombination $attributeCombination) use ($modelFactory){
$attribute = $modelFactory->buildModel('Attribute', $propelAttribute);

// Reset attribute av to all for next use of attribute (because of propel "cache")
$propelAttribute->setAttributeAvs($attributeAvBackup);
$propelAttribute->clearAttributeAvs();
return $attribute;
},
iterator_to_array($theliaModel->getAttributeCombinations())
Expand Down Expand Up @@ -485,4 +484,4 @@ public function setPromoPrice($promoPrice)
$this->promoPrice = $promoPrice;
return $this;
}
}
}

0 comments on commit 9565b03

Please sign in to comment.