Menu Close
    Start a Project Request quote Reading list Switch to dark mode

    How to load Product and Product Collection for a particular Store in Magento 2?

    Magento provide multi-store feature which comes in handy if we want to create store for multiple languages. Magento allows us to set different details for different stores for a single product. So suppose you have created two stores, one for English and one for Hindi then you can set different product name, description and various other details in both language for the same product.

    In this blog I’ll explain how you can load a product model or the products collection for a particular store. Please check out the code given below,

    Here the getProduct function takes the store id and the product id as parameter and it runs the product model for that specific store.

    And the getProductCollection function takes store id as parameter and returns the product collection for that specific store view.

    Thank you for reading the blog. Feel free to comment if you face any issue.

    Happy coding 👨 💻

    . . .

    Comment (1)

    Add Your Comment

  • Keshav Dussal
    As I am beginner to Magento 2 Can you please provide detail description of the above code.
  • Back to Top
    Hire Us!
    Brief us about your requirements and we'll get back to you.
    Woo! Hooy!
    We have just recieved your project brief and our expert will contact you shortly.
    Send Again