From 86f7218679fd1630cdd96712eadc5af0e997f64c Mon Sep 17 00:00:00 2001 From: Pfabeck Date: Thu, 21 Sep 2017 19:22:40 +0200 Subject: [PATCH] WareHouseFix (#229) * WareHouseFix * Update CHANGELOG.md --- .../ResponseParser/Product/Stock/StockResponseParser.php | 4 ++-- CHANGELOG.md | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Adapter/PlentymarketsAdapter/ResponseParser/Product/Stock/StockResponseParser.php b/Adapter/PlentymarketsAdapter/ResponseParser/Product/Stock/StockResponseParser.php index d2ddcdaee..cb7b6a447 100644 --- a/Adapter/PlentymarketsAdapter/ResponseParser/Product/Stock/StockResponseParser.php +++ b/Adapter/PlentymarketsAdapter/ResponseParser/Product/Stock/StockResponseParser.php @@ -96,11 +96,11 @@ private function getStock($variation) return $warehouse['typeId'] === self::SALES_WAREHOUSE; }); - $warehouses = array_column($warehouses, 'typeId'); + $warehouses = array_column($warehouses, 'id'); } foreach ($variation['stock'] as $stock) { - if (in_array($stock['warehouseId'], $warehouses, true)) { + if (!in_array($stock['warehouseId'], $warehouses, true)) { continue; } diff --git a/CHANGELOG.md b/CHANGELOG.md index f487787ac..76d75c05d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Fixed - settings could not be saved in some shopware versions +- warehouse selection for item stock calculation was using the wrong identifier ### Changed - client will retry on 500 errors, too