cancel
Showing results for 
Search instead for 
Did you mean: 

not able to show actual total price at the line item in cart page without deducting the discount/promotional offer

Former Member
0 Kudos

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);
 }

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi Naresh, Thanks for your reply. In cartItems tag it is entry.totalPrice attribute which is used. But while sending the model i am changing the total price in each entry in the cartin the above method which i mentioned earlier. But still it is not reflecting. I am a bit confused.