Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
0 answers
29 views

List products including out of stock products in custom module (without listing out of stock products on the whole shop!)

I’m having a custom route in a custom module where I’d like to list a subset of products for a specific search criteria. I’d like to include here just for this action the out of stock products. BUT I ...
denis's user avatar
  • 101
0 votes
1 answer
350 views

difference between collection and repository in magento 2

I am not understanding the concept difference between collection and repository in magento2 and which is better to use. your help will be able to appreciate.
Muhammad Zahoor's user avatar
1 vote
1 answer
489 views

What is the difference between Collection & Repository & Factory classes?

I am trying to understand when to is use which according to the best practice. for exg. To get some data like (product,customer) what should be used Collection ? To set some data into product etc what ...
dev php's user avatar
  • 45
4 votes
0 answers
204 views

How to handle multiple tables with magento 2 repositories?

As we all know, magento 2 suggests using repositories as an additional layer between resource models/collections and the rest of application. It's all pretty straightforward and simple when you use it ...
Luke's user avatar
  • 802
1 vote
0 answers
883 views

How to load a model with relationships via repository in Magento 2?

Background story: I was trying to load a model with model_store relationship using this snippet. I failed to do that with my own model. Model is being loaded without store data. Some debuging later I ...
Luke's user avatar
  • 802
25 votes
1 answer
934 views

Are collections history in Magento 2?

I know that a lot of code that is currently in Magento 2 (2.1.2) is more or less ported from Magento 1 and that a lot of code will be substituted by an equivalent in the future. In this aspect, I'm ...
Giel Berkers's user avatar
  • 12.3k