Skip to content

Commit 1cd00d6

Browse files
author
Bohdan Berezhniy
committed
13320 make rest api works with localizations
1 parent 5514f4e commit 1cd00d6

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Model/AbstractManagement.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,11 @@ public function delete($id)
175175
public function get($id, $storeId = 0)
176176
{
177177
try {
178-
$item = $this->_itemFactory->create()
179-
->setStoreId($storeId);
178+
$item = $this->_itemFactory->create();
179+
180+
if ($storeId) {
181+
$item->setStoreId((int)$storeId);
182+
}
180183

181184
$item->load($id);
182185

@@ -200,6 +203,11 @@ public function view($id, $storeId)
200203
{
201204
try {
202205
$item = $this->_itemFactory->create();
206+
207+
if ($storeId) {
208+
$item->setStoreId((int)$storeId);
209+
}
210+
203211
$item->getResource()->load($item, $id);
204212

205213
if (!$item->isVisibleOnStore($storeId)) {

0 commit comments

Comments
 (0)