Bug reports Found a bug? Post it here please.
Version 5.x > Bug reports > Products without product options doesn't show price View modes: 
User avatar
Member
Member
spectro-jarlen - 7/1/2011 12:24:57 PM
   
Products without product options doesn't show price
Hi, I'm using the e-commerce site and currently have set up product options for my products. However, not all products have product options. Those products which don't have product options only are showing the "add to cart" and "wishlist" but don't show the total price. I still need to show the price even when there aren't any product options. Is there a known workaround?

User avatar
Member
Member
kentico_michal - 7/4/2011 4:57:57 AM
   
RE:Products without product options doesn't show price
Hello,

By default, the price is displayed only if there is any option available for the current product. In order to circumvent this default behavior, you will need to change the code of the ShopiingCartItemSelector control that you can find in ~\CMSModules\Ecommerce\Controls\ProductOptions\ShoppingCartItemSelector.ascx.cs. The only thing you need to change is the following condition in the Page_PreRender method:


ORIGINAL CONDITION:

if ((this.ShowTotalPrice) && (OptionCategoryInfoProvider.GetSKUOptionsCount(this.SKUID) > 0))

NEW CONDITION:

if ((this.ShowTotalPrice))


It is also necessary to set the ShowTotalPrice property of the CartItemSelector control to true:

<uc1:CartItemSelector runat="server" ShowTotalPrice="true" ...


Best regards,
Michal Legen

User avatar
Member
Member
spectro-jarlen - 7/9/2011 2:18:08 PM
   
RE:Products without product options doesn't show price
Thank you Michal, that worked perfectly! :)