Skip to main content
Tweeted twitter.com/StackMagento/status/1181539887247433728

I already have a products collection and an empty page, how would I load the products list layout and use my own products collection?

EDIT:

EDIT:

Better explanation hopefully. I have a form to select year, make, model, and then category, which works well. I got a product collection, I just want to display the collection in a standard product listing using the currently loaded theme but the solution eludes me.

The Year, make model and associated products are stored in their own models. I didn't see a good way to store them in standard magento attributes as most products have several combinations of year, make, models.

EDIT2:

EDIT2: GotGot somewhere by adding this to my layout but by default it just shows all products. Possible to change the products displayed int hein the block?

<block class="Magento\Catalog\Block\Product\ListProduct" name="ymmResult" template="Magento_Catalog::product/list.phtml" />

I already have a products collection and an empty page, how would I load the products list layout and use my own products collection?

EDIT:

Better explanation hopefully. I have a form to select year, make, model, and then category, which works well. I got a product collection, I just want to display the collection in a standard product listing using the currently loaded theme but the solution eludes me.

The Year, make model and associated products are stored in their own models. I didn't see a good way to store them in standard magento attributes as most products have several combinations of year, make, models.

EDIT2: Got somewhere by adding this to my layout but by default it just shows all products. Possible to change the products displayed int he block?

<block class="Magento\Catalog\Block\Product\ListProduct" name="ymmResult" template="Magento_Catalog::product/list.phtml" />

I already have a products collection and an empty page, how would I load the products list layout and use my own products collection?

EDIT:

Better explanation hopefully. I have a form to select year, make, model, and then category, which works well. I got a product collection, I just want to display the collection in a standard product listing using the currently loaded theme but the solution eludes me.

The Year, make model and associated products are stored in their own models. I didn't see a good way to store them in standard magento attributes as most products have several combinations of year, make, models.

EDIT2:

Got somewhere by adding this to my layout but by default it just shows all products. Possible to change the products displayed in the block?

<block class="Magento\Catalog\Block\Product\ListProduct" name="ymmResult" template="Magento_Catalog::product/list.phtml" />
Notice removed Draw attention by Tyler
Bounty Ended with Aaron Allen's answer chosen by Tyler
Added block info EDIT2
Source Link
Tyler
  • 273
  • 1
  • 6
  • 16

I already have a products collection and an empty page, how would I load the products list layout and use my own products collection?

EDIT:

Better explanation hopefully. I have a form to select year, make, model, and then category, which works well. I got a product collection, I just want to display the collection in a standard product listing using the currently loaded theme but the solution eludes me.

The Year, make model and associated products are stored in their own models. I didn't see a good way to store them in standard magento attributes as most products have several combinations of year, make, models.

EDIT2: Got somewhere by adding this to my layout but by default it just shows all products. Possible to change the products displayed int he block?

<block class="Magento\Catalog\Block\Product\ListProduct" name="ymmResult" template="Magento_Catalog::product/list.phtml" />

I already have a products collection and an empty page, how would I load the products list layout and use my own products collection?

EDIT:

Better explanation hopefully. I have a form to select year, make, model, and then category, which works well. I got a product collection, I just want to display the collection in a standard product listing using the currently loaded theme but the solution eludes me.

The Year, make model and associated products are stored in their own models. I didn't see a good way to store them in standard magento attributes as most products have several combinations of year, make, models.

I already have a products collection and an empty page, how would I load the products list layout and use my own products collection?

EDIT:

Better explanation hopefully. I have a form to select year, make, model, and then category, which works well. I got a product collection, I just want to display the collection in a standard product listing using the currently loaded theme but the solution eludes me.

The Year, make model and associated products are stored in their own models. I didn't see a good way to store them in standard magento attributes as most products have several combinations of year, make, models.

EDIT2: Got somewhere by adding this to my layout but by default it just shows all products. Possible to change the products displayed int he block?

<block class="Magento\Catalog\Block\Product\ListProduct" name="ymmResult" template="Magento_Catalog::product/list.phtml" />
added 12 characters in body
Source Link
Tyler
  • 273
  • 1
  • 6
  • 16

I already have a products collection and an empty page, how would I load the products list layout and use my own products collection?

EDIT:

Better explanation hopefully. I have a form to select year, make, model, and then category, which works well. I got a product collection, I just want to display the collection in a standard wayproduct listing using the currently loaded theme but the solution eludes me.

The Year, make model and associated products are stored in their own models. I didn't see a good way to store them in standard magento attributes as most products have several combinations of year, make, models.

I already have a products collection and an empty page, how would I load the products list layout and use my own products collection?

EDIT:

Better explanation hopefully. I have a form to select year, make, model, and then category, which works well. I got a product collection, I just want to display the collection in a standard way using the currently loaded theme but the solution eludes me.

The Year, make model and associated products are stored in their own models. I didn't see a good way to store them in standard magento attributes as most products have several combinations of year, make, models.

I already have a products collection and an empty page, how would I load the products list layout and use my own products collection?

EDIT:

Better explanation hopefully. I have a form to select year, make, model, and then category, which works well. I got a product collection, I just want to display the collection in a standard product listing using the currently loaded theme but the solution eludes me.

The Year, make model and associated products are stored in their own models. I didn't see a good way to store them in standard magento attributes as most products have several combinations of year, make, models.

Notice added Draw attention by Tyler
Bounty Started worth 50 reputation by Tyler
added 489 characters in body
Source Link
Tyler
  • 273
  • 1
  • 6
  • 16
Loading
Source Link
Tyler
  • 273
  • 1
  • 6
  • 16
Loading