Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > Product default transformation: Show the link 'Registe Now' when item quantity is finished otherwise show 'Add to cart'. View modes: 
User avatar
Member
Member
sandip.patil-acapteam - 6/18/2009 5:50:00 AM
   
Product default transformation: Show the link 'Registe Now' when item quantity is finished otherwise show 'Add to cart'.
Hi i m using the module e-commerce in my site here i need some help from u.

I m showing the product details using the product's default transformation here i want to show "Add to cart" link when product is having enough quantity and "Register Now" link when quantity of the product is finished.
Transformation of the product is below(giving the error by using this)
Check the row below price in the code.

<%@ Register Src="~/CMSModules/Ecommerce/Controls/ProductOptions/ShoppingCartItemSelector.ascx" TagName="CartItemSelector" TagPrefix="uc1" %>
<h1 style="margin-top:15px"><%# Eval("ProductName", true) %></h1>
<table cellspacing="0" cellpadding="0" class="productDetail">
<tr>
<td style="text-align:center; vertical-align:top;">
</td>
<td>
<table class="productDetailInfo" cellspacing="0" cellpadding="0">
<tr>
<td class="caption"><h3>Parameters:</h3></td>
<td> </td>
</tr>
<tr>
<td>Code:</td>
<td align="left"><%# Eval("ProductCode") %></td>
</tr>
<tr class="alt">
<td>Offers in:</td>
<td align="left"><%# Eval("ProductType") %></td>
</tr>
<tr>
<td>Tier:</td>
<td align="left"><%# Eval("ProductTier") %>    <a href="~/SpecialPages/Tier-Info.aspx">What is tier?</a></td>
</tr>
<tr class="alt">
<td>PDUs:</td>
<td align="left"><%# Eval("PDUs") %></td>
</tr>
<tr>
<td>Duration in Hours:</td>
<td align="left"><%# Eval("Duration") %></td>
</tr>
<tr class="alt">
<td>Dates:</td>
<td align="left"><%# GetDateTime("StartDate", "dd MMM yyyy") %> To <%# GetDateTime("EndDate", "dd MMM yyyy") %></td>
</tr>
<td class="caption">Available Seats:</td>
<td class="caption"><%# IfEmpty(Eval("SKUAvailableItems"), "Sorry, course is filled up. Please Register/request this course and you will be notified when the next one is offered in this location.", Eval("SKUAvailableItems")) %></td>
<tr>
</table>
</td>
<tr>
<tr>
<td colspan="2">
<div class="productDetailLinks">
<table width="100%">
<tr>
<td align="left">
<strong>Price: <span class="ProductPrice"><%# EcommerceFunctions.GetFormatedPrice(Eval("SKUPrice"), Eval("SKUDepartmentID")) %></span></strong>
</td>
<td>
<%# IfEmpty(Eval("SKUAvailableItems"), "Register Now", <uc1:CartItemSelector id="cartItemSelector" runat="server" SKUID='<%# ValidationHelper.GetInteger(Eval("SKUID"), 0) %>' SKUEnabled='<%# ValidationHelper.GetBoolean(Eval("SKUEnabled"), false) %> ' AddToCartImageButton="addtocart.gif" AddToCartLinkText="Add to cart" ShowProductOptions="true" ShowUnitsTextBox="true"/>) %>
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td colspan="2">
<h3>Description:</h3>
<div>
<%# Eval("SKUDescription") %>
</div>
</td>
</tr>
</table>

User avatar
Member
Member
sandip.patil-acapteam - 6/18/2009 9:16:54 AM
   
RE:Product default transformation: Show the link 'Registe Now' when item quantity is finished otherwise show 'Add to cart'.
Solved use below code


<%@ Register Src="~/CMSModules/Ecommerce/Controls/ProductOptions/ShoppingCartItemSelector.ascx" TagName="CartItemSelector" TagPrefix="uc1" %>
<h1 style="margin-top:15px"><%# Eval("ProductName", true) %></h1>
<table cellspacing="0" cellpadding="0" class="productDetail">
<tr>
<td style="text-align:center; vertical-align:top;">
</td>
<td>
<table class="productDetailInfo" cellspacing="0" cellpadding="0">
<tr>
<td class="caption"><h3>Parameters:</h3></td>
<td> </td>
</tr>
<tr>
<td>Code:</td>
<td align="left"><%# Eval("ProductCode") %></td>
</tr>
<tr class="alt">
<td>Offers in:</td>
<td align="left"><%# Eval("ProductType") %></td>
</tr>
<tr>
<td>Tier:</td>
<td align="left"><%# Eval("ProductTier") %>    <a href="~/SpecialPages/Tier-Info.aspx">What is tier?</a></td>
</tr>
<tr class="alt">
<td>PDUs:</td>
<td align="left"><%# Eval("PDUs") %></td>
<tr>
</tr>
<td>Duration in Hours:</td>
<td align="left"><%# Eval("Duration") %></td>
</tr>
<tr class="alt">
<td>Dates:</td>
<td align="left"><%# GetDateTime("StartDate", "dd MMM yyyy") %> To <%# GetDateTime("EndDate", "dd MMM yyyy") %></td>
</tr>
<td class="caption">Available Seats:</td>
<td class="caption">
<%# IfCompare(Eval("SKUAvailableItems"), 0, Eval("SKUAvailableItems"), "Sorry, course is filled up.<br/>Please Register/request this course and you will be notified when the next one is offered in this location.") %>
</td>
<tr>
</table>
</td>
<tr>
<tr>
<td colspan="2">
<div class="productDetailLinks">
<table width="100%">
<tr>
<td align="left">
<strong>Price: <span class="ProductPrice"><%# EcommerceFunctions.GetFormatedPrice(Eval("SKUPrice"), Eval("SKUDepartmentID")) %></span></strong>
</td>
<td runat="server" visible='<%# ((int)Eval("SKUAvailableItems")) == 0 ? false : true %>'>
<uc1:CartItemSelector id="cartItemSelector" runat="server" SKUID='<%# ValidationHelper.GetInteger(Eval("SKUID"), 0) %>' SKUEnabled='<%# ValidationHelper.GetBoolean(Eval("SKUEnabled"), false) %> ' AddToCartImageButton="addtocart.gif" AddToCartLinkText="Order Now" ShowProductOptions="true" ShowUnitsTextBox="true"/>
</td>
<td runat="server" visible='<%# ((int)Eval("SKUAvailableItems")) == 0 ? true : false %>'>
<a href="~/SpecialPages/Tier-Info.aspx">Register Now</a>
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td colspan="2">
<h3>Description:</h3>
<div>
<%# Eval("SKUDescription") %>
</div>
</td>
</tr>

</table>