Scenario, add a new value to the Inventory Type in the admin screen for a Product.
to do: Create a new class in the admin: org.broadleafcommerce.core.order.service.type.MyInventoryType
Code: Select all
public class MyInventoryType extends InventoryType {
private static final long serialVersionUID = 1L;
public static final InventoryType NONE = new InventoryType("PREORDER", "Pre-Publication");
}
Next reference it using mo:overrides
in the top of the xml of applicationContext-admin.xml, verify or add
Code: Select all
xmlns:mo="http://schema.broadleafcommerce.org/mo"
then append to xsi:schemaLocation
Code: Select all
http://schema.broadleafcommerce.org/mo
http://schema.broadleafcommerce.org/mo/mo-2.2.xsd
next, add the mo:override tag and configuration
Code: Select all
<mo:override id="blMetadataOverrides">
<mo:overrideItem ceilingEntity="org.broadleafcommerce.core.catalog.domain.Product">
<mo:field name="defaultSku.inventoryType">
<mo:property name="broadleafEnumeration" value="org.broadleafcommerce.core.order.service.type.MyInventoryType" />
</mo:field>
</mo:overrideItem>
</mo:override>
explanation:
the ceilingEntity is ultimately the entity that the information is located at.
field name is the field you are wanting to add to from the ceiling entity point of view.
property is enumeration type, and the value being the class that you just created.
build and start it up.