Developer forum

Forum » Ecommerce - Standard features » Display default product unit

Display default product unit

Kasper Skov
Reply

How can I display the default product unit name in a template? Pseudo-code:

@i.GetValue("Ecom:Product.Unit.Default.Name")

The only thing I can up with from the documentation is the default ID with Ecom:Product.DefaultUnitID, which is useless in my situation.


Replies

 
Nicolai Høeg Pedersen
Reply

Hi Kasper

I think it is only available from the Units loop:

http://templates.dynamicweb-cms.com/eCommerce/Dynamicweb-eCommerce-template-tags/Product-Catalog/Product-detail/Loops/Units.aspx

So you can loop them, and test for if it is selected (<!--@Ecom:VariantOption.Selected-->) and then print that line only...

BR Nicolai

 
Kasper Skov
Reply

Ah right, thanks. I overlooked the loops.

 
Kasper Skov
Reply

I cant seem to get the loop rolling with razor.

foreach (LoopItem u in GetLoop("Units"))

Any ideas?

 

You must be logged in to post in the forum