Data Types

When you want to be in control of how the fields on products and categories are edited, a custom data type is just the thing you need. In this exercise you will create a new editor to set up tax groups on a product level to support differentiated tax per product.

 


Relevant APIs

UCommerce.Presentation.Web.Controls
IControlFactory
IControlAdapter

UCommerce.EntitiesV2
DataType
PriceGroup
IRepository<T>

Hands-on

  1. Create a new class called "PriceGroupFactory".
  2. Implement IControlFactory.
  3. Register component in a new app called "Differential Tax".
  4. Set up a new data type in Ucommerce back-end in settings.
  5. Pick the Price Group component.
  6. Create a new field on a product definition using the new data type.
  7. Edit a product with the field set up.
{{lineitem.ProductName}}

{{lineitem.VariantName}} - {{lineitem.Quantity}} x {{lineitem.FormattedPrice}} {{lineitem.FormattedPrice}}

Your cart is empty ;(
Total {{basket.FormattedProductsTotal}}
Checkout