Tracking recent browse history in broadleaf?
Posted: Sun Jun 22, 2014 11:49 am
by gowthamgutha
I would like to track the recent items that are browsed by the user in the current session just as what most e-commerce sites do.
How could I do that?
Thanks in advance. Hope you will reply as soon as possible.
Re: Tracking recent browse history in broadleaf?
Posted: Mon Jun 23, 2014 12:00 pm
by phillipuniverse
A filter would probably be the most appropriate. I would add it to the blPostSecurityFilterChain at the very end in applicationContext-filter.xml, after blURLHandlerFilter. You could then get the current customer with CustomerState.getCustomer() and if the URL matches some Product URL you could increment whatever session counter that you wanted.
Alternatively you could forego the filter and just do it in the ProductController and add your custom logic there.