Need help in Kentico 8.1 E-Commerce Feature Implemetation

Rahul Raghuvanshi asked on October 10, 2014 12:20


I am developing a Kentico 8.1 in which implementing E-Commerce feature with the reference of Kentico E-Commerce sample site.

I am stuck or facing problem in following implementations:

1) "Shopping cart preview" web part configuration: I have configured Shopping Cart Preview, with setting following properties

Total price title:Edit value:{% GetAmountText(ECommerceContext.CurrentShoppingCart.TotalUnits, "item for ", "items for ") + FormatPrice(ECommerceContext.CurrentShoppingCart.TotalPrice)#%}

Show total price title: checked

As I have configured all the setting as per the Kentico e-commerce sample website, but instead of getting expected result that is "item count items for $item amount (like 2 items for $10.00)", I am getting text "Total Price" in webpart result.

Please help me or guide me which setting is missing or where I am doing wrong?

2) How can I show/hide CartItemSelector control in transformation based on condition if item is available in stock, I explored for any attribute setting to hide or show with using
<%#IfCompare(IsSKUInStock(), true,"none","block")%>, but didn't get any thing, currently used following trick which is not legal.

<div class="cart clearfix" style="display: <%#IfCompare(IsSKUInStock(), true,"none","blocak")%>"> <uc1:CartItemSelector id="addItem" runat="server" SKUID='<%#EvalInteger("SKUID")%>' SKUEnabled='<%#EvalBool("SKUEnabled")%> ' AddToCartTooltip="Add to cart" AddToCartLinkText="Add to cart" />

Please let me know or suggest me trick by which I can achieve the same.

3) How I can get number of available item in stock in transformation via any method ?

I know its vary basic questions, as I am new with Kentico e-commerce implementation, your guidance will be very much helpful for me.

Thanks in advance.

Thanks in Advance.

Recent Answers

Ivana Liptakova answered on October 31, 2014 08:50


1) You do not need to use shopping cart preview web part to display requested data. It is sufficient to use Static HTML web part and into its Text property (using the small black triangle)insert following code with macros:

<div class="shopping-cart-mini-preview"> <a href="{%Settings.CMSShoppingCartURL#%}"> <div class="shopping-cart-mini-preview-label"> YOUR CART </div> <span class="shopping-cart-mini-preview-value"> {% ECommerceContext.CurrentShoppingCart.TotalUnits|(resolver)WebPartRender #%} {% (ECommerceContext.CurrentShoppingCart.TotalUnits == 1)? "item" : "items" |(resolver)WebPartRender #%} ({% FormatPrice(ECommerceContext.CurrentShoppingCart.TotalPrice)|(resolver)WebPartRender #%}) </span> </a> </div>

The part with |(resolver)WebPartRender ensures that macro is resolved when web part is rendered. It means that macro is updated when shopping cart content is changed.

2) Try to set style property like: <%# Convert.ToInt32(Eval("SKUAvailableItems")) >= 50 ? "" : "display:none;"%>

3) Eval("SKUAvailableItems") might be what you are looking for.

Best regards,

Ivana Tomanickova

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.