Recent Bloggers

Saurang Suthar
Posts: 5
Stars: 0
Date: 7/4/17
Jyoti Verma
Posts: 3
Stars: 0
Date: 6/28/17
Pankti Patel
Posts: 1
Stars: 0
Date: 5/26/17
Chandrika Baraiya
Posts: 5
Stars: 0
Date: 5/26/17
Atith Patel
Posts: 5
Stars: 0
Date: 5/22/17
Nisarg Pujara
Posts: 6
Stars: 0
Date: 5/10/17
Pranavsinh Parmar
Posts: 4
Stars: 0
Date: 5/3/17
Ankit Prajapati
Posts: 5
Stars: 0
Date: 5/3/17
Pratik Solanki
Posts: 5
Stars: 0
Date: 4/7/17
Chirag Patel
Posts: 4
Stars: 0
Date: 3/30/17
« Back

Implement OrderReturn feature in Broadleaf

Recently we came across the requirement where we need to implement order return module on broadleaf framework as broadleaf community edition doesn’t provide it out of the box.

 

Order Return functionality implementation :
Step : 1 - Create new custom entity for Order Return

Step : 2 - Order Return functionality implementation

 

Step : 1  Create new custom entity for Order Return functionality using below steps :

  • First, create the new class named OrderReturn.

  • Create required fields as mentioned in diagram for above created entity.

  • Build your project after following above steps.

  • Now OrderReturn table will be created in your database.

  • Set below properties in development properties file(path : site/src/main/resources/runtime-properties/development.properties)

blPU.hibernate.hbm2ddl.auto=update

blEventPU.hibernate.hbm2ddl.auto=update

blSecurePU.hibernate.hbm2ddl.auto=update

blEventPU.hibernate.hbm2ddl.auto=update

 

  • Create new entity in broadleafcommerce.

Create new entity in broadleaf for implement order return functionality.

 

Step: 2 Order Return functionality implementation :

  • You need to create required interfaces, classes, HTML files, and entity. Below are the steps to create it.

    • Create new orderReturn.html file.

    • Edit orderHistory.html file in a way that you can redirect to orderReturn form.

    • Create required classes and interfaces to handle behavior/state of the Order Return functionality.

    • Create a new controller to handle all the request/response for order return functionality.

      • For example, when the user submits the Order Return form then pass filled information into the controller and then persist it. After then send an email to the user.
    • Now add below lines in applicationContext.xml file to scan your package.

      <context:component-scan base-package="com.st.broadleaf.ordereturn"/>

      <context:component-scan base-package="com.st.broadleaf.controller.OrderReturn"/>

       

    • Now add below lines in applicationContext-entity.xml file to load your bean class.

      <bean id="com.st.broadleaf.controller.OrderReturn" class="com.st.broadleaf.ordereturn.OrderReturnImpl" scope="prototype"/>

  • Implement order return in broadleafcommerce.

 

  • Your Broadleafcommerce project structure should look like below after implementing Order Return functionality.
  • core

    • src/main/java

      • com.st.broadleaf.ordereturn

        • OrderRerurn(Interface)

        • OrderReturnImpl(class)

        • ChangeOrderStatus(class)

        • CustomOrderStatus(class)

        • OrderReturnForm(class)
           

      • com.st.broadleaf.dao.ordereturn

        • OrderRetuenDao(Interface)

        • OrderReturnDaoImpl(class)
           

      • com.st.broadleaf.service.ordereturn

        • OrderReturnService(Interface)

        • OrderReturnSeriviceImpl(class)
           

  • site

    • Java Resources

      • src/main/java

        • com.st.broadleaf.controller.ordereturn

          • OrderReturnController(class)
Comments

Contact Us

Loading

Get in touch

Headquarter :
302, Landmark,
Nr. Titanium City Center,
Prahlad Nagar Road,
Ahmedabad, India - 380015.