Documentation Home

Module Installation

The price list module requires configuration and database changes.
There are optional DB scripts to load sample data for the Broadleaf demo.

Configuration Changes

Step 1. Add the dependency management section to your parent pom.xml:

<dependency>
    <groupId>com.broadleafcommerce</groupId>
    <artifactId>broadleaf-pricelist</artifactId>
    <version>1.2.0-GA</version>
    <type>jar</type>
    <scope>compile</scope>
</dependency>

Step 2. Pull this dependency into your core/pom.xml:

<dependency>
    <groupId>com.broadleafcommerce</groupId>
    <artifactId>broadleaf-pricelist</artifactId>
</dependency>

Step 3. You'll need to include the Web Filter in your site module that sets up the PricingContext. In the file, applicationContext-filter.xml ensure that the pricelist line below is added just before the blCartStateFilter.

<bean id="blPostSecurityFilterChain" class="org.springframework.security.web.FilterChainProxy">
    <sec:filter-chain-map request-matcher="ant">
        <sec:filter-chain pattern="/**" filters="
           blRequestFilter,
           blCustomerStateFilter,
           blTranslationFilter,
           blPriceListRequestFilter,
           blCartStateFilter,
           blURLHandlerFilter"/>
    </sec:filter-chain-map>
</bean>

Step 4. Finally, ensure load time weaving is enabled for your application server, as this module uses load time weaving. If you haven't already done so, you will need to modify the provided site and admin build.xml commands (e.g. jetty-demo) to include the following line:

<jvmarg value="-javaagent:${spring.instrument.path}" /> 

You can download the Spring Instrument jar from https://github.com/BroadleafCommerce/DemoSite/raw/master/lib/spring-instrument-3.2.2.RELEASE.jar. To read more about load time weaving see http://docs.broadleafcommerce.org/core/current/appendix/load-time-weaving

Data Changes

Schema Changes

If you are allowing hibernate to create and modify your tables, this will be done automatically when you restart with the new configuration settings.

Otherwise, you will need to generate the SQL to customize your Broadleaf implementation. See the Broadleaf Schema Upgrade Documentation for details.

Admin Security Changes

To maintain price lists in the Broadleaf admin, you will need to load new permissions. The recommended changes are located in the following file and include a new Admin menu item with access granted to the Admin and Merchandiser roles.

    /config/bc/sql/load_pricelist_admin_security.sql,\

Note: In development, you can automatically load this SQL by adding this file to the blPU.hibernate.hbm2ddl.import_files property in the development-shared.properties file.

Optional Data Changes

If you want to augment the heat clinic demo data with country price lists data, reference the additional SQL file in development-shared.properties in the blPU.hibernate.hbm2ddl.import_files property:

/config/bc/sql/samples/load_pricelist_demo_data.sql

Note: The demo data script must be placed after the '/sql/load_content_structure_i18n.sql' entry since it relies on the currency and country data.