Commerce pricing display

HI There,

I’m using a resource based product catalogue as per the docs here:
https://docs.modmore.com/en/Commerce/v1/Product_Catalog/Resource.html

In my pdoResources call, I have a chunk with the details f the product (image, Sku, and price)
I’m using the pricing TV - but I can’t work out how to output just the price?

At the moment I’m using:
[[!+tv.price]]

Which outputs:

Price: {"SEK":{"regular_price":"250","price_types":[]}}

How can I output the price as: 250:-

Also - I’m using a test version - does this mean that the stock control doesn’t work?
I have 1 in stock for every product, but if I ‘buy’ one in test mode, the stock still says 1.

Sorry - very new to this, and for some reason I’m finding the docs tricky!

Thanks in advance for any help!

Andy

Already answered your ticket about this, but for others coming across this: when using resource products you need to parse pricing with the get_product snippet.

For example:

[[!commerce.get_product? 
    &product=`[[commerce.get_resource_product_id]]`
    &field=`price_rendered`
]]

For stock control, make sure the Update Stock module is enabled. Should work just fine with resources, too, but make sure to call the placeholder uncached (or render it through get_product) as the resource cache wont be cleared on each sale.

2 Likes