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:



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

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.