Help,ProductOptionsProcessor Not work

Topics related to running, modifying, or working with the Broadleaf Commerce Demo application

Moderator: jocanas

Posts: 4
Joined: Mon Mar 28, 2016 10:03 pm

Help,ProductOptionsProcessor Not work

Postby jammyjaccy » Thu May 19, 2016 9:02 am

I have a customer processer copy from ProductOptionsProcessor,only add a print in the method ,the code is

Code: Select all

private void writeJSONToModel(Arguments arguments, String modelKey, Object o) {
        try {
            String jsonValue = JSON_CACHE.get(o);
            if (jsonValue == null) {
                ObjectMapper mapper = new ObjectMapper();
                Writer strWriter = new StringWriter();
                mapper.writeValue(strWriter, o);
                jsonValue = strWriter.toString();
                JSON_CACHE.put(o, jsonValue);
  "-----" + jsonValue + "-----");
            addToModel(arguments, modelKey, jsonValue);
            Object result =((Map<String, Object>) arguments.getExpressionEvaluationRoot()).get(modelKey);
  "-------------------------------- " + result.toString()) ;
        } catch (Exception ex) {
            LOG.error("There was a problem writing the product option map to JSON", ex);

when i visit the product page,and the productOptions.html use the tag blc:eshop_product_options,and the tomcat will print something like this:
[2016-05-19 21:36:29 INFO ] [http-apr-80-exec-4] {cn.ebuzz.eshop.core.web.processor.EshopProd
uctOptionsProcessor:145}--------------------------------- [{"price":"¥16.99","selectedOption

but the productOptions page still have the code :

Code: Select all

<div id="product-option-data" th:attr="data-product-option-pricing=${skuPricing}, data-product-options=${allProductOptions}" />

when F12,find the html sourcecode ,it will be :

Code: Select all

<div id="product-option-data"></div>

anyone can give me some help!? how to fix this? thanks !

Return to “Broadleaf Commerce Demo”

Who is online

Users browsing this forum: No registered users and 1 guest