3

Whenever I edit a product, the Store View (scope) is set to "All Store Views" each time.

In my particular setup, I would like this to default to Main Website > Main Website Store > Default Store View, but can't find a way to do it.

Any advice? The solution can be a configuration setting or programmatic, I don't mind.

1 Answer 1

4

The admin link is generate by this method

\Magento\Catalog\Ui\Component\Listing\Columns\ProductActions::prepareDataSource()
As you can see there is already a line that checks for a store id

$storeId = $this->context->getFilterParam('store_id');.
You can write an around plugin on this method. You will basically keep the same code but replace the line mentioned above with $storeId = 1(or other value if you have a different one)

2
  • That's superb - it worked a treat. Many thanks!
    – Geat
    Nov 23, 2016 at 22:04
  • Can you please send me around method code here @marius because I'm getting error in Magento version 2.3.3
    – Ronak
    May 19, 2020 at 16:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.