The following article describes how you can work with product units in Dynamicweb eCommerce.
Product units such as box and crate can be used to create variants of products, so that you can offer products to your customers in other quantities than single products.
The first thing you need to do is to create a range of product units in the Dynamicweb administration:
Create as many product units as you like by following the procedure mentioned above.
When you are done creating product units, you should locate the product that you want to display in your web shop in different units.
Choose the Units tab and go through the following steps to add different units to the product:
Now you are ready to offer the product in the activated units.
A product in different units is considered as variations of the same product. This also means that when you activate the various units for the product a series of product variants will be created.
To output the variants in the webshop you will need to use the Units template loop. In the loop you can use the same tags as when outputting variants. (See the template tag reference for further information).
The following example shows how to create a dropdown menu using the Units loop:
<!--@LoopStart(Units)-->
<!--@HeaderStart-->
<h2 class="h2">Product units</h2>
<select name="Variants">
<!--@HeaderEnd-->
<option value="<!--@Ecom:VariantOption.ID-->" <!--@Ecom:VariantOption.Selected--><!--@Ecom:VariantOption.Name--></option>
<!--@FooterStart-->
</select>
<!--@FooterEnd-->
<!--@LoopEnd(Units)--">