Hybris: show error message on storefront -
in case product offline, want show error message on storefront same when user checkouts @ cart page. updated source code in controller class , added error message globalmessages below:
globalmessages.addmessage(model, globalmessages.error_messages_holder, "basket.validation.offlineproduct", new object[] { productdata.getname(), producturl, quantity });
i added error property "basket.validation.offlineproduct" in property file below:
basket.validation.offlineproduct=unfortunately <a href="{1}">{0}</a> removed cart offline. had {2} in cart.
but error message not getting displayed, although on debugging custom code being called , error message code being set model.
other setting required display error message present in jsp file below:
<%@ taglib prefix="common" tagdir="/web-inf/tags/desktop/common" %> <common:globalmessages/>
i checked other controller file source code, , process seems same , error message getting displayed on other pages. tried deleting cache , restarting server.
if i'd try next things:
1)try show message without parameters, example - "product removed cart offline"
. if working - problem in attributes.
2)try use else rather globalmessages
, like
string error = l10nservice.getlocalizedstring("basket.validation.offlineproduct",new object[] { productdata.getname(), producturl, quantity }); model.addattribute("producterror", error);
Comments
Post a Comment