List products using pdoResources on homepage, best practices

So I am starting a webshop for wine, where the client will sell packages of different wines.
Am using seperate bottles of wine as ‘products’ and have ‘bundles’ where he will add three wines to each and sell those…

Have a Collection resource with a MODX resource for each ‘bundles’ and assigned Commerce bundle there:

On home I want to display 3 of the latest ‘bundles’. I assume the best way is to use a pdoResoruces call:

[[!pdoResources?
              &parents=`2`
              &tpl=`sl_commerce_homepage_row.chunk`
              &tvPrefix=``
              &includeTVs=`products`
              &processTVs=`1`
              &processTVs=`1`
]]

And:
sl_commerce_homepage_row.chunk

<a href="[[~[[+id]]]]">
  <h3>[[+longtitle:default=`[[+pagetitle]]`]]</h3>
  <p>[[!commerce.get_product? &product=`[[+id]]` &field=`price_formatted`]]</p>
</a>

But here it goes wrong, how can I display the commerce bundle price?

[[!commerce.get_product? &product=`[[+id]]` &field=`price_formatted`]]

Does not work, the ID is the resource but I need the related Commerce product (bundle)

The product list TV holds a comma separated list of product IDs. So if your TV there has the bundles, you will need to do this inside your chunk:

[[!commerce.get_product? &product=`[[+products]]` &field=`price_formatted`]]

If multiple products are passed to the singular &product, the snippet will just use the first valid one.

1 Like

Thanks! that was easy.