cancel
Showing results for 
Search instead for 
Did you mean: 

How to customize JSP pages used with an AddOn?

former_member583621
Participant

I'm working wtih Hybris 6.2, we have an Addon which we wish to use to customize the checkout pages in the storefront. Out of the box, these pages are inserted into another JSP from what we've seen and are changed accordingly to the current step the checkout process is.

I read the guides from this page but haven't come across with something that could help me.

We tried to customize the AddPaymentMethodPage.jsp, so we copied the JSP to our AddOn at acceleratoraddon/web/webroot/WEB-INF/views/responsive/pages/checkout/multi.

We compiled our enviroment and I can see the JSP from our addon being copied to the storefront extension at web/webroot/WEB-INF/views/addons/OUR_ADDON/responsive/pages/checkout/multi.

But our customized JSP isn't being used on the storefront.

I don't know how to tell the storefront to use our customized JSP instead of the one set by default during the process of checkout, I checked the initialdata but there's not mapping for these JSPs, which makes sense and the ControllerConstants.java contains the path to the page that should be loaded, for AddPaymentMethodPage.jsp the definition is like this:

 interface Views
 {
     interface Cms // NOSONAR
     {
         String ComponentPrefix = "cms/"; // NOSONAR
     }

     interface Pages
     {
         ...

         interface MultiStepCheckout // NOSONAR
         {
             ...
             String AddPaymentMethodPage = "pages/checkout/multi/addPaymentMethodPage"; // NOSONAR
             ...
         }
                    ...
     }
             ...
 }

There's no mention from where the pages are loaded, so I take the decision to load it from default or from the AddOn is made somewhere else.

What configuration do I have to perform to accomplish this?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

If you want to call the addon jsp page, then you have to change the redirected view name in your controller to something like below:

 return "addon:/yourcustomstorefrontaddon/pages/checkout/multi/addPaymentMethodPage";

former_member583621
Participant
0 Kudos

thank you, this worked like a charm, sorry for the late comment, been busy at work

Answers (0)