ASPX templates
Version 6.x > ASPX templates > JavaScript In Transformation View modes: 
User avatar
Member
Member
fali.sheru-gmail - 6/26/2013 2:40:21 AM
   
JavaScript In Transformation
Hi, I'm new to Kentico so please bare with me.

This is my question I'm using Kentico v6 and have following codes in my transformation

<CMS:CartItemSelector ID="cisAddToCart" SKUID='<%# ValidationHelper.GetInteger(Eval("SKUID"), 0) %>' SKUEnabled='<%# ValidationHelper.GetBoolean(Eval("SKUEnabled"), false) %> ' AddToCartLinkText="Add to cart" ShowUnitsTextBox="true"  runat="server" />


This button currently will add item selected to Shopping Cart and user will be directed to Shopping Cart but before that happens I want to check whether the item is low stock or not available and alert the user.

How am I able to do that in a simple way. Please guide me.

Thank you.

User avatar
Kentico Support
Kentico Support
kentico_janh - 6/27/2013 2:14:59 AM
   
RE:JavaScript In Transformation
Hello,

You need to edit that registered control in the\CMSModules\Ecommerce\Controls\ProductOptions\ShoppingCartItemSelector.ascx.cs file and update the AddProductToShoppingCart method to contain something like:

if (SKU.SKUAvailableItems < Quantity)
{
error = "Not enough available items";
}


Best regards,
Jan Hermann

User avatar
Member
Member
fali.sheru-gmail - 6/27/2013 8:02:17 PM
   
RE:JavaScript In Transformation
Thank you very much :). This is what I wanted.