From 5b2e27d98f9ea4f834a2a5dfafb2b7184f3cd0f9 Mon Sep 17 00:00:00 2001 From: Damian Murawski Date: Tue, 1 Oct 2019 00:24:41 +0200 Subject: [PATCH] fix position, get position from product in taxon --- src/PropertyBuilder/ProductTaxonPositionPropertyBuilder.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PropertyBuilder/ProductTaxonPositionPropertyBuilder.php b/src/PropertyBuilder/ProductTaxonPositionPropertyBuilder.php index 96380c2f..ee0b520e 100644 --- a/src/PropertyBuilder/ProductTaxonPositionPropertyBuilder.php +++ b/src/PropertyBuilder/ProductTaxonPositionPropertyBuilder.php @@ -21,9 +21,9 @@ public function consumeEvent(TransformEvent $event): void { $this->buildProperty($event, ProductInterface::class, function (ProductInterface $product, Document $document): void { - foreach ($product->getTaxons() as $taxon) { + foreach ($product->getProductTaxons() as $taxon) { $document->set( - $this->taxonPositionNameResolver->resolvePropertyName($taxon->getCode()), + $this->taxonPositionNameResolver->resolvePropertyName($taxon->getTaxon()->getCode()), $taxon->getPosition() ); }