How to create new commerce item type?
In the orderReposiry.xml, create an item descriptor by extending the default commerce item using inheritance concept (specifying super-type and sub-type) and adding the new properties with new table under this item descriptor. Then we will create a new java bean by extending the CommerceItemImpl and adding setters and getters for the properties created in the new commerce item item descriptor. After that we will specify the new commerce item details in the OrderTools.properties and specify commerceItemTypeClassMap and beanNameToItemDescriptorMap.
How to add newly created commerce item type to the order?
We will set up a map of sku item types to the commerce item types in the CommerceItemManager.properties. Then we will override the CommerceItemManager's createCommerceItem method. We will take the skuId (catalogRefId) and find its SKU item type and then from this name we will look up the map values in the CommerceItemManager.properties to search for its related commerceItem type to create.
In the orderReposiry.xml, create an item descriptor by extending the default commerce item using inheritance concept (specifying super-type and sub-type) and adding the new properties with new table under this item descriptor. Then we will create a new java bean by extending the CommerceItemImpl and adding setters and getters for the properties created in the new commerce item item descriptor. After that we will specify the new commerce item details in the OrderTools.properties and specify commerceItemTypeClassMap and beanNameToItemDescriptorMap.
How to add newly created commerce item type to the order?
We will set up a map of sku item types to the commerce item types in the CommerceItemManager.properties. Then we will override the CommerceItemManager's createCommerceItem method. We will take the skuId (catalogRefId) and find its SKU item type and then from this name we will look up the map values in the CommerceItemManager.properties to search for its related commerceItem type to create.
No comments:
Post a Comment