Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to load product store wise? #1246

Closed
sivajik34 opened this issue May 7, 2015 · 2 comments
Closed

how to load product store wise? #1246

sivajik34 opened this issue May 7, 2015 · 2 comments
Labels
bug report Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Progress: needs update

Comments

@sivajik34
Copy link
Contributor

i think in ProductRepository class following function will load product store wise by given sku.but store_id not using any where.how to load product store wise?
Actually i want set product status website wise.
for example 1 product included in 2 websites.and i want set product status in first website enable.in second website disable.
public function get($sku, $editMode = false, $storeId = null, $forceReload = false)
{
$cacheKey = $this->getCacheKey(func_get_args());
if (!isset($this->instances[$sku][$cacheKey]) || $forceReload) {
$product = $this->productFactory->create();

        $productId = $this->resourceModel->getIdBySku($sku);
        if (!$productId) {
            throw new NoSuchEntityException(__('Requested product doesn\'t exist'));
        }
        if ($editMode) {
            $product->setData('_edit_mode', true);
        }
        $product->load($productId);
        $this->instances[$sku][$cacheKey] = $product;
        $this->instancesById[$product->getId()][$cacheKey] = $product;
    }
    return $this->instances[$sku][$cacheKey];
}
@kokoc
Copy link
Member

kokoc commented May 12, 2015

@sivajik34 You are right. StoreId parameter is ignored by get method. This behavior is definitely a bug. Appropriate item is created in backlog - MAGETWO-37275. Thank you for contacting us.

@kokoc kokoc added bug report Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development and removed question labels May 12, 2015
@kokoc
Copy link
Member

kokoc commented May 27, 2015

@sivajik34 The fix is now available in 0.74.0-beta10. Thank you very much for your contribution and continued support to Magento 2! Could you please verify the issue?

magento-team pushed a commit that referenced this issue Oct 5, 2017
MAGETWO-69822: Prepare code base for 2.0.16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Progress: needs update
Projects
None yet
Development

No branches or pull requests

4 participants