Skip to content

Commit 561d098

Browse files
committed
Updated lookup
1 parent 69f4cdc commit 561d098

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Lookup.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,12 @@ public function transform(): \Generator
3232
$lookup = $this->cache->get(sprintf($this->cacheKey, $line[$this->mappingField]));
3333

3434
if ($lookup === null) {
35-
$lookup = $this->client->catalogCategoryAttributeOptionManagementV1GetItemsGet(
35+
$results = $this->client->catalogProductAttributeOptionManagementV1GetItemsGet(
3636
attributeCode: $this->attributeCode,
3737
);
3838

39+
$lookup = array_values(array_filter($results, fn (object $item) => $item->getValue() === $line[$this->mappingField]))[0];
40+
3941
if (!$lookup instanceof \Kiboko\Magento\V2_1\Model\EavDataAttributeOptionInterface
4042
&& !$lookup instanceof \Kiboko\Magento\V2_2\Model\EavDataAttributeOptionInterface
4143
&& !$lookup instanceof \Kiboko\Magento\V2_3\Model\EavDataAttributeOptionInterface

0 commit comments

Comments
 (0)