Announcement: You can find the guides for Commerce 7.5 and later on the new Elastic Path Documentation site. This site contains the guides for Commerce 6.13.0 through 7.4.1.Visit new site

This version of Elastic Path Commerce is no longer supported or maintained. To upgrade to the latest version, contact your Elastic Path representative.

Creating a State Policy extension point

Creating a State Policy extension point

In order to Creating a State Policy Contribution, you must add a State Policy extension point to the plugin.

To create a State Policy extension point for a plugin, do the following:

  1. Open plugin.xml in Eclipse.
  2. In the Extension Points tab, click the Add button next to the All Extension Points list.
  3. In the New Extension Point dialog, enter the following:
    Extension Point ID statePolicy

    Extension Point Name

    State Policy

    Extension Point Schema

    Leave blank and make sure Edit extension point schema when done is selected

    Click Finish. A new schema file named statePolicy.exsd is created and is displayed automatically.
  4. In the Source tab of the statePolicy.exsd file, paste the following:
    1. <?xml version='1.0' encoding='UTF-8'?>
    2. <!-- Schema file written by PDE -->
    3. <schema targetNamespace="com.elasticpath.cmclient.admin.gc" xmlns="http://www.w3.org/2001/XMLSchema">
    4. <element name="extension">
    5. <complexType>
    6. <sequence minOccurs="1" maxOccurs="unbounded">
    7. <element ref="statePolicyContribution"/commerce-legacy/>
    8. </sequence>
    9. <attribute name="point" type="string" use="required"/commerce-legacy/>
    10. </complexType>
    11. </element>
    12. <element name="statePolicyContribution">
    13. <complexType>
    14. <attribute name="targetId" type="string" use="required">
    15. <annotation>

    Copy

    ...
    Read more