From 973ec2a1646c94c0bbd6d51ea27376fa9bb1e1ef Mon Sep 17 00:00:00 2001 From: ade Date: Fri, 3 Jul 2020 10:37:38 +0200 Subject: [PATCH] feature/evr-299-magento - set storeId to get correct product URL --- .../local/Ev/Productapi/Model/Api2/Product/Rest/Admin/V1.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/code/local/Ev/Productapi/Model/Api2/Product/Rest/Admin/V1.php b/app/code/local/Ev/Productapi/Model/Api2/Product/Rest/Admin/V1.php index 6d3fbf7..2aa1fc7 100644 --- a/app/code/local/Ev/Productapi/Model/Api2/Product/Rest/Admin/V1.php +++ b/app/code/local/Ev/Productapi/Model/Api2/Product/Rest/Admin/V1.php @@ -95,8 +95,11 @@ private function handleSearch($searchQuery) ); $collection->setPageSize(10)->setCurPage(1); $products = $collection->load(); + $store = Mage::app()->getDefaultStoreView(); + $storeId = $store->getStoreId(); foreach ($products as $product) { + $product->setStoreId($storeId); $this->_prepareProductForResponse($product); }