Subversion Repositories SmartDukaan

Rev

Rev 4934 | Rev 5001 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4934 Rev 4965
Line 99... Line 99...
99
    	    categoryUrl = productPropertiesInJson.getString("categoryUrl");
99
    	    categoryUrl = productPropertiesInJson.getString("categoryUrl");
100
    	    displayAccessories = productPropertiesInJson.getString("displayAccessories");
100
    	    displayAccessories = productPropertiesInJson.getString("displayAccessories");
101
    	    breadCrumb = productPropertiesInJson.getString("breadCrumb");
101
    	    breadCrumb = productPropertiesInJson.getString("breadCrumb");
102
    	}
102
    	}
103
    	catch (JSONException e) {
103
    	catch (JSONException e) {
104
            log.error("Unable to parse product properties JSON", e);
104
            log.warn("Unable to parse product properties JSON", e);
105
            try {
105
            try {
106
                CatalogClient catalogClientService = new CatalogClient();
106
                CatalogClient catalogClientService = new CatalogClient();
107
                in.shop2020.model.v1.catalog.InventoryService.Client client = catalogClientService.getClient();
107
                in.shop2020.model.v1.catalog.InventoryService.Client client = catalogClientService.getClient();
108
                
108
                
109
                Item item = client.getItemsByCatalogId(productId).get(0);
109
                Item item = client.getItemsByCatalogId(productId).get(0);
110
                redirectUrl = "/" + item.getBrand().toLowerCase().replace(" ", "-");
110
                redirectUrl = "/" + item.getBrand().toLowerCase().replace(" ", "-");
111
            } catch (Exception e1) {
111
            } catch (Exception e1) {
112
                log.error("Unable to get items by catalog id", e1);
112
                log.warn("Unable to get items by catalog id", e1);
113
                redirectUrl = "/";
113
                redirectUrl = "/";
114
            }
114
            }
115
            log.info(redirectUrl);
115
            log.info(redirectUrl);
116
            return "redirect";
116
            return "redirect";
117
       }
117
       }