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

Product collection - Add url rewrite from different website #1462

Merged
merged 1 commit into from
Jul 29, 2015
Merged

Product collection - Add url rewrite from different website #1462

merged 1 commit into from
Jul 29, 2015

Conversation

ihor-sviziev
Copy link
Contributor

When you trying inside admin controller load product collection for specific store and add url rewrites to select - "request_path" attribute will be set to "false" because inside select we have incorrect store selector, used current store $this->_storeManager->getStore()->getId()), not that we set in product collection.

Code example in admin controller:

//Retrieve product collection object
$productCollection = ...;

$productCollection
    ->setStore($store)
    ->addUrlRewrite();

var_dump($productCollection->getFirstItem()->getData('request_path')); // There will be "false"

I found this issue in Magento 1.9.1, but code in this peace of code same in Magento 2.

@kokoc
Copy link
Member

kokoc commented Jul 21, 2015

@ihor-sviziev thank you for the contribution! Internal reference: MAGETWO-40634

@magento-team magento-team merged commit dc4d975 into magento:develop Jul 29, 2015
@ihor-sviziev ihor-sviziev deleted the patch-2 branch July 29, 2015 11:38
magento-team pushed a commit that referenced this pull request Sep 6, 2017
[EngCom] Public Pull Requests - 2.1
 - MAGETWO-72253: Backport of MAGETWO-52102 for Magento 2.1: [Github] Custom theme stat… #10753
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants