on 05-08-2015 3:46 PM
Hi
There is a requirement to show actual total price for each product wihtout subracting the discount(any promotional offer/discount) at the line item. But currently the out of box functionality is showing the total price after deducting the discount/promotional offers.
So i modified the entry as below in createProductList() method of CartPageController before adding the cartData to model. entry.getTotalPrice().setValue(BigDecimal.valueOf(entry.getQuantity()).multiply(entry.getBasePrice().getValue()));
But i am not getting the updated total price to front end pages.It is still showing the old total price every time.
Can you please let me where am i doing wrong and suggest me how to acheive it.
Please see the code below for reference
protected void createProductList(final Model model) throws CMSItemNotFoundException { CartData cartData = cartFacade.getSessionCart(); reverseCartProductsOrder(cartData.getEntries()); if (cartData.getEntries() != null && !cartData.getEntries().isEmpty()) {
for (OrderEntryData entry : cartData.getEntries())
{
final UpdateQuantityForm uqf = new UpdateQuantityForm();
uqf.setQuantity(entry.getQuantity());
entry.getTotalPrice().setValue(BigDecimal.valueOf(entry.getQuantity()).multiply(entry.getBasePrice().getValue()));
model.addAttribute("updateQuantityForm" + entry.getEntryNumber(), uqf);
}
}
storeCmsPageInModel(model, getContentPageForLabelOrId(CART_CMS_PAGE));
setUpMetaDataForContentPage(model, getContentPageForLabelOrId(CART_CMS_PAGE));
model.addAttribute("cartData", cartData);
}
The price of a product on the cart page and the PDP page are controlled by productPricePopulaotor. chek what value are you getting over there and the pries are converted to the PriceData. Pl check on cartItems.tag as what attribute you are using for displaying the price tag.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
8 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.