Page MenuHomeIn-Portal Phabricator

modern-store
No OneTemporary

File Metadata

Created
Wed, Feb 12, 3:16 AM

modern-store

Index: branches/1.0.x/cart.tpl
===================================================================
--- branches/1.0.x/cart.tpl (revision 15018)
+++ branches/1.0.x/cart.tpl (revision 15019)
@@ -1,295 +1,306 @@
<!--##
<NAME>Shopping Cart</NAME>
<DESC></DESC>
<SECTION>Pages||Checkout</SECTION>
##-->
<inp2:m_DefineElement name="page_title">Shopping Cart</inp2:m_DefineElement>
<inp2:m_DefineElement name="add_to_head">
<script src="<inp2:m_TemplatesBase />inc/js/cart_manager.js" type="text/javascript"></script>
</inp2:m_DefineElement>
<!--## MAIN CONTENT ##-->
<inp2:m_DefineElement name="content">
+ <inp2:m_Include template="elements/options.elm" strip_nl="2"/>
<ul class="steps">
<li class="step1 active"><a href="<inp2:m_Link pass='m,all'/>"><i></i>Shopping Cart</a></li>
<li class="step2"><span><i></i>One-step Checkout</span></li>
<li class="step3"><span><i></i>Receipt</span></li>
</ul>
<div class="clear"></div>
<form method="post" id="shopping-cart-form" action="<inp2:m_FormAction />">
<div class="cart-detail receipt shoppingcart">
<!--<div style="border: 1px dashed blue; padding: 3px; margin-bottom: 5px; font-size: 14px; font-family: 'Courier New', monospace;">
<inp2:ord_CheckoutErrorNew/>
</div>-->
<inp2:m_DefineElement name="cart_header_element">
<h1>Shopping Cart</h1>
<div class="buttons-right">
<a href="<inp2:ord_ContinueShoppingLink template='__default__'/>" class="continue-button"><span>Continue Shopping</span></a>
<a href="<inp2:m_Link template='checkout'/>" class="checkout-button"><span>Checkout</span></a>
</div>
<div class="clear"></div>
<table class="items">
<thead>
<tr>
<th colspan="2" style="text-align: left;">Items in your order (<span id="item-count"><inp2:ord_ItemsInCart/></span>)</th>
<th>Qty.</th>
<th>Price</th>
<th>Total</th>
<th></th>
</tr>
</thead>
<tbody id="shop-cart-table">
</inp2:m_DefineElement>
<inp2:m_DefineElement name="cart_item_element">
<tr class="shop-cart-row" row_index="<inp2:RowIndex/>" order_item_id="<inp2:Field name='OrderItemId'/>">
<td class="item-img"<inp2:m_if check="HasOptions"> rowspan="2"</inp2:m_if>>
<inp2:p_Image render_as="image_element" Primary="1" MaxWidth="58" DefaultWidth="58" DefaultImage="img/no_picture.gif"/>
</td>
<td class="item-title">
<div style="font-size: 14px; font-family: 'Courier New', monospace;">
[ProductId: <strong><inp2:Field name="ProductId"/></strong>; OptionsSalt: <strong><inp2:Field name="OptionsSalt"/></strong>; BackOrderFlag: <strong><inp2:Field name="BackOrderFlag"/></strong>]
</div>
<inp2:m_if check="Field" field="Virtual" equals_to="0" db="db">
<a href="<inp2:ProductLink template='__default__'/>"><inp2:Field name="Name" /></a>
<inp2:m_if check="FreePromoShippingAvailable">
&nbsp;<sup><inp2:m_phrase label="lu_cart_FreeShippingAvailable" /></sup>
</inp2:m_if>
<inp2:m_else/>
<inp2:Field name="Name" />
</inp2:m_if>
<inp2:m_if check="ord_BackorderFlag">
<span class="error"><inp2:m_phrase label="lu_cart_BackorderFlag" /></span>
</inp2:m_if>
<inp2:m_if check="p_Field" name="cust_Availability" db="db">
<br />
<inp2:p_CustomField name="Availability"/>
</inp2:m_if>
<div class="product-discount"<inp2:m_ifnot check="HasDiscount"> style="display: none;"</inp2:m_ifnot>>
<inp2:m_Phrase label="lu_comm_RegularPrice" />: <span class="item-price"><inp2:Field name="FlatPrice" currency="selected"/></span><br />
<inp2:m_Phrase label="lu_comm_Discount" />: <span class="item-discount"><inp2:Field name="ItemDiscount" currency="selected" negative="1" /></span>
</div>
</td>
<td>
<div class="item-quantity">
<inp2:m_if check="IsTangible">
<input value="<inp2:Field field='Quantity'/>" class="field product-qty" name="<inp2:InputName field='Quantity'/>" id="<inp2:InputName field='Quantity'/>" />
<inp2:m_else />
<span class="product-qty read-only"><inp2:Field field="Quantity"/></span>
</inp2:m_if>
</div>
</td>
<td class="price-cell">
<inp2:Field name="Price" currency="selected" decimal_tag="span"/>
</td>
<td class="item-total extended-price-cell">
<inp2:Field name="ExtendedPrice" currency="selected" decimal_tag="span"/>
</td>
<td>
<a href="<inp2:LinkRemoveFromCart/>" class="delete-cart-link"><img src="<inp2:m_TemplatesBase/>img/icon-delete.png" width="13" height="13" alt="Delete" /></a>
</td>
</tr>
<inp2:m_if check="HasOptions">
<tr>
<td class="options-td" colspan="5">
- <div class="sel-options">
+ <inp2:m_if check="DisplayOptionsPricing">
+ <inp2:PrintOptions render_as="ro_option_element" currency="selected"/>
+ <inp2:m_else/>
+ <inp2:PrintOptions render_as="ro_option_element_no_price" currency="selected"/>
+ </inp2:m_if>
+
+ <inp2:m_if check="FieldEquals" field="OptionsSelectionMode" value="0">
+ <a href="<inp2:p_ProductLink template='__default__' pass='m,p,orditems'/>">Edit Options</a>
+ </inp2:m_if>
+
+ <!--<div class="sel-options">
<label><strong>Select Size:</strong>
<select name="select">
<option value="" selected="selected">22"</option>
<option value="">23"</option>
</select>
</label>
</div>
<div class="sel-options">
<label><strong>Select Color:</strong>
<select name="select">
<option value="" selected="selected">Gray Metallic</option>
<option value="">White Metallic</option>
<option value="">Black Metallic</option>
</select>
</label>
- </div>
+ </div>-->
</td>
</tr>
</inp2:m_if>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="cart_footer_element">
</tbody>
</table>
<div class="discount-block">
<p><strong>Discounts & Promotional Offers</strong></p>
<div id="coupon-row">
<div class="used"<inp2:m_ifnot check="ord_Field" name="CouponId" db="db"> style="display: none;"</inp2:m_ifnot>>
<inp2:m_Phrase label="lu_comm_CouponHasBeenApplied" />:&nbsp;
<div class="num-discount">
<span class="coupon-name"><inp2:ord_Field field="CouponName" /></span>&nbsp;&nbsp;
<a id="remove-coupon" href="<inp2:ord_RemoveCouponLink type='coupon'/>"><img src="<inp2:m_TemplatesBase/>img/icon-delete.png" title="<inp2:m_Phrase label='lu_comm_RemoveCoupon' no_editing='1'/>" alt="<inp2:m_Phrase label='lu_comm_RemoveCoupon' no_editing='1'/>" width="13" height="13" border="0" /></a>
</div>
</div>
<div class="not-used"<inp2:m_if check="ord_Field" name="CouponId" db="db"> style="display: none;"</inp2:m_if>>
<p>If you have a discount or promotional offer code please enter it and click Apply button.</p>
<div class="num-discount form">
<input class="field coupon-code" name="coupon_code" value=""/>
<input type="button" class="grey-button" id="apply-coupon" value="Apply"/>
</div>
</div>
</div>
<!-- hide gift certificate row by design, but it's fully functional -->
<div id="gift-certificate-row" style="display: none;">
<div class="used"<inp2:m_ifnot check="ord_Field" name="GiftCertificateId" db="db"> style="display: none;"</inp2:m_ifnot>>
<inp2:m_Phrase label="lu_comm_GiftCertificateHasBeenApplied" />:&nbsp;
<div class="num-discount">
<span class="gift-certificate-discount"><inp2:ord_Field field="GiftCertificateDiscount" currency="selected" /></span>&nbsp;&nbsp;
<a id="remove-gift-certificate" href="<inp2:ord_RemoveCouponLink type='gift_certificate'/>"><img src="<inp2:m_TemplatesBase/>img/icon-delete.png" title="<inp2:m_Phrase label="lu_comm_RemoveGiftCertificate" no_editing="1"/>" alt="<inp2:m_Phrase label="lu_comm_RemoveGiftCertificate" no_editing="1"/>" width="13" height="13" border="0" /></a>
</div>
</div>
<div class="not-used"<inp2:m_if check="ord_Field" name="GiftCertificateId" db="db"> style="display: none;"</inp2:m_if>>
<p>If you have a gift certificate code please enter it and click Apply button.</p>
<div class="num-discount form">
<input class="field gift-certificate-code" name="giftcert_code" />
<input type="button" class="grey-button" id="apply-gift-certificate" value="Apply"/>
</div>
</div>
</div>
</div>
<div class="buttons-right">
<dl class="total">
<div id="discount-row"<inp2:m_ifnot check="ord_HasDiscount"> style="display: none;"</inp2:m_ifnot>>
<dt class="discount">Discount:</dt>
<dd class="price2">- <inp2:ord_Field name="DiscountTotal" currency="selected" decimal_tag="span"/></dd>
</div>
<div>
<dt>Total</dt>
<dd class="price1" id="sub-total"><inp2:ord_Field field="SubTotal" currency="selected" decimal_tag="span"/></dd>
</div>
</dl>
<p>(before shipping & taxes)</p>
<a href="<inp2:m_Link template='checkout'/>" class="checkout-grey-button"><span>Checkout</span></a>
</div>
<div class="clear"></div>
<script type="text/javascript">
var $aShopCartManager = new ShopCartManager(
{
updateUrl: '<inp2:m_Link ord_event="OnUpdateCartJSON" currency="selected" pass="m,ord" js_escape="1" no_amp="1"/>',
constants: {
'OrderCheckoutErrorType::PRODUCT': <inp2:m_GetConst name="OrderCheckoutErrorType::PRODUCT"/>,
'OrderCheckoutError::FIELD_UPDATE_SUCCESS': <inp2:m_GetConst name="OrderCheckoutError::FIELD_UPDATE_SUCCESS"/>,
'OrderCheckoutError::FIELD_UPDATE_ERROR': <inp2:m_GetConst name="OrderCheckoutError::FIELD_UPDATE_ERROR"/>,
'OrderCheckoutError::QTY_UNAVAILABLE': <inp2:m_GetConst name="OrderCheckoutError::QTY_UNAVAILABLE"/>,
'OrderCheckoutError::QTY_OUT_OF_STOCK': <inp2:m_GetConst name="OrderCheckoutError::QTY_OUT_OF_STOCK"/>,
'OrderCheckoutError::QTY_CHANGED_TO_MINIMAL': <inp2:m_GetConst name="OrderCheckoutError::QTY_CHANGED_TO_MINIMAL"/>,
'OrderCheckoutErrorType::COUPON': <inp2:m_GetConst name="OrderCheckoutErrorType::COUPON"/>,
'OrderCheckoutError::COUPON_APPLIED': <inp2:m_GetConst name="OrderCheckoutError::COUPON_APPLIED"/>,
'OrderCheckoutError::COUPON_REMOVED': <inp2:m_GetConst name="OrderCheckoutError::COUPON_REMOVED"/>,
'OrderCheckoutError::COUPON_REMOVED_AUTOMATICALLY': <inp2:m_GetConst name="OrderCheckoutError::COUPON_REMOVED_AUTOMATICALLY"/>,
'OrderCheckoutError::COUPON_CODE_INVALID': <inp2:m_GetConst name="OrderCheckoutError::COUPON_CODE_INVALID"/>,
'OrderCheckoutError::COUPON_CODE_EXPIRED': <inp2:m_GetConst name="OrderCheckoutError::COUPON_CODE_EXPIRED"/>,
'OrderCheckoutErrorType::GIFT_CERTIFICATE': <inp2:m_GetConst name="OrderCheckoutErrorType::GIFT_CERTIFICATE"/>,
'OrderCheckoutError::GC_APPLIED': <inp2:m_GetConst name="OrderCheckoutError::GC_APPLIED"/>,
'OrderCheckoutError::GC_REMOVED': <inp2:m_GetConst name="OrderCheckoutError::GC_REMOVED"/>,
'OrderCheckoutError::GC_REMOVED_AUTOMATICALLY': <inp2:m_GetConst name="OrderCheckoutError::GC_REMOVED_AUTOMATICALLY"/>,
'OrderCheckoutError::GC_CODE_INVALID': <inp2:m_GetConst name="OrderCheckoutError::GC_CODE_INVALID"/>,
'OrderCheckoutError::GC_CODE_EXPIRED': <inp2:m_GetConst name="OrderCheckoutError::GC_CODE_EXPIRED"/>,
'OrderCheckoutErrorType::DISCOUNT': <inp2:m_GetConst name="OrderCheckoutErrorType::DISCOUNT"/>,
'OrderCheckoutError::DISCOUNT_APPLIED': <inp2:m_GetConst name="OrderCheckoutError::DISCOUNT_APPLIED"/>,
'OrderCheckoutError::DISCOUNT_REMOVED': <inp2:m_GetConst name="OrderCheckoutError::DISCOUNT_REMOVED"/>,
'PRODUCT_TYPE_TANGIBLE': <inp2:m_GetConst name="PRODUCT_TYPE_TANGIBLE"/>
},
// debugMode: true,
currencyMask: '<inp2:ord_CurrencyMask currency="selected" js_escape="1"/>',
orderInfo: <inp2:ord_PrintOrderInfo currency="selected"/>
}
);
</script>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="cart_empty_element">
<h1>Shopping Cart</h1>
<div class="clear"></div>
<strong><inp2:m_Phrase label="lu_comm_YourCartIsEmpty"/></strong>
</inp2:m_DefineElement>
<inp2:ord_PrintCart item_render_as="cart_item_element" header_render_as="cart_header_element" footer_render_as="cart_footer_element" empty_cart_render_as="cart_empty_element" per_page="-1"/>
</div>
</form>
<textarea id="product-row-mask" style="display: none;">
<tr class="shop-cart-row" row_index="{ROW_INDEX}" order_item_id="{field:OrderItemId}">
<td class="item-img">
<img src="{field:PrimaryImage}" alt=""/>
</td>
<td class="item-title">
<span class="product-with-link" style="display: none;">
<a href="#"></a>
</span>
<span class="product-without-link" style="display: none;"></span>
<span class="free-shipping">
&nbsp;<sup><inp2:m_phrase label="lu_cart_FreeShippingAvailable" /></sup>
</span>
<span class="back-order-mark error"><inp2:m_phrase label="lu_cart_BackorderFlag" /></span>
<span class="product-availability" style="display: none;"></span>
<div class="product-discount" style="display: none;">
<inp2:m_Phrase label="lu_comm_RegularPrice" />: <span class="item-price"></span><br />
<inp2:m_Phrase label="lu_comm_Discount" />: <span class="item-discount"></span>
</div>
</td>
<td>
<div class="item-quantity">
<input value="{field:Quantity}" style="width:20px" class="field product-qty" name="<inp2:orditems_InputName field='Quantity' force_id="{field:OrderItemId}"/>" id="<inp2:orditems_InputName field='Quantity' force_id="{field:OrderItemId}"/>" />
<span class="product-qty read-only">{field:Quantity}</span>
</div>
</td>
<td class="price-cell"></td>
<td class="item-total extended-price-cell"></td>
<td>
<a href="#" class="delete-cart-link"><img src="<inp2:m_TemplatesBase/>img/icon-delete.png" width="13" height="13" alt="Delete" /></a>
</td>
</tr>
</textarea>
</inp2:m_DefineElement>
<!--## /MAIN CONTENT ##-->
<!--## DESIGN TEMPLATE ##-->
<inp2:m_include template="designs/default_design.des" pass_params="1"/>
<!--## /DESIGN TEMPLATE ##-->
\ No newline at end of file
Index: branches/1.0.x/receipt.tpl
===================================================================
--- branches/1.0.x/receipt.tpl (revision 15018)
+++ branches/1.0.x/receipt.tpl (revision 15019)
@@ -1,188 +1,201 @@
<!--##
<NAME>Receipt</NAME>
<DESC></DESC>
<SECTION>Pages||Checkout</SECTION>
##-->
<inp2:m_DefineElement name="page_title">Your Receipt</inp2:m_DefineElement>
<inp2:m_DefineElement name="order_field_element" title="lu_fld_{$field}">
<inp2:m_if check="{$prefix}_Field" name="$field">
<dt class="label-title"><inp2:m_Phrase name="$title"/>:</dt>
<dd><inp2:$prefix_Field field="$field"/></dd>
</inp2:m_if>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="orderitem_elem">
<tr>
- <td class="item-img">
+ <td class="item-img"<inp2:m_if check="HasOptions"> rowspan="2"</inp2:m_if>>
<inp2:p_Image render_as="image_element" Primary="1" MaxWidth="58" DefaultWidth="58" DefaultImage="img/no_picture.gif"/>
</td>
<td class="item-title">
<inp2:Field name="ProductName"/><inp2:m_if check="ord_BackorderFlag"> <span><inp2:m_phrase label="lu_cart_BackorderFlag" /></span></inp2:m_if>
<inp2:m_if check="HasDiscount">
<br />
<inp2:m_Phrase label="lu_comm_RegularPrice" />: <inp2:Field name="FlatPrice" currency="selected"/><br />
<inp2:m_Phrase label="lu_comm_Discount" />: <span><inp2:Field name="ItemDiscount" currency="selected" negative="1"/></span>
</inp2:m_if>
</td>
<td><inp2:Field name="Quantity"/></td>
<td><inp2:Field name="Price" currency="selected"/></td>
<td><inp2:Field name="ExtendedPrice" currency="selected"/></td>
</tr>
+
+ <inp2:m_if check="HasOptions">
+ <tr>
+ <td class="options-td" colspan="5">
+ <inp2:m_if check="DisplayOptionsPricing">
+ <inp2:PrintOptions render_as="ro_option_element" currency="selected"/>
+ <inp2:m_else/>
+ <inp2:PrintOptions render_as="ro_option_element_no_price" currency="selected"/>
+ </inp2:m_if>
+ </td>
+ </tr>
+ </inp2:m_if>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="order_form_shipping">
<fieldset>
<div class="fieldset">
<label>Shipping Information</label>
</div>
<dl class="info">
<dt class="label-title">Shipping Type & Cost:</dt>
<dd>
<inp2:ord_ShippingType /> <inp2:ord_Field name="ShippingCost" currency="selected"/>
</dd>
<inp2:m_RenderElement name="order_field_element" prefix="$PrefixSpecial" field="ShippingTo" title="lu_fld_FullName"/>
<inp2:m_RenderElement name="order_field_element" prefix="$PrefixSpecial" field="ShippingEmail" title="lu_fld_Email"/>
<inp2:m_RenderElement name="order_field_element" prefix="$PrefixSpecial" field="ShippingCompany" title="lu_fld_Company"/>
<dt class="label-title">Address:</dt>
<dd>
<inp2:m_if check="Field" field="ShippingAddress1">
<inp2:Field field="ShippingAddress1"/><br/>
</inp2:m_if>
<inp2:m_if check="Field" field="ShippingAddress2">
<inp2:Field field="ShippingAddress2"/><br/>
</inp2:m_if>
<inp2:PrintLocation type="Shipping"/>
</dd>
<inp2:m_RenderElement name="order_field_element" prefix="$PrefixSpecial" field="ShippingPhone" title="lu_fld_Phone"/>
<inp2:m_RenderElement name="order_field_element" prefix="$PrefixSpecial" field="ShippingFax" title="lu_fld_Fax"/>
</dl>
</fieldset>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="order_form_billing">
<fieldset>
<div class="fieldset">
Billing Information
</div>
<dl class="info">
<inp2:m_RenderElement name="order_field_element" prefix="$PrefixSpecial" field="BillingTo" title="lu_fld_FullName"/>
<inp2:m_RenderElement name="order_field_element" prefix="$PrefixSpecial" field="BillingEmail" title="lu_fld_Email"/>
<inp2:m_RenderElement name="order_field_element" prefix="$PrefixSpecial" field="BillingCompany" title="lu_fld_Company"/>
<dt class="label-title">Address:</dt>
<dd>
<inp2:m_if check="Field" field="BillingAddress1">
<inp2:Field field="BillingAddress1"/><br/>
</inp2:m_if>
<inp2:m_if check="Field" field="BillingAddress2">
<inp2:Field field="BillingAddress2"/><br>
</inp2:m_if>
<inp2:PrintLocation type="Billing"/>
</dd>
<inp2:m_RenderElement name="order_field_element" prefix="$PrefixSpecial" field="BillingPhone" title="lu_fld_Phone"/>
<inp2:m_RenderElement name="order_field_element" prefix="$PrefixSpecial" field="BillingFax" title="lu_fld_Fax"/>
</dl>
</fieldset>
<fieldset class="creditcard">
<div class="fieldset">
Payment Information
</div>
<inp2:m_if check="UsingCreditCard">
<p>
<inp2:Field name="PaymentCardType"/> <inp2:Field name="PaymentAccount" masked="masked"/>
</p>
<dl class="info">
<inp2:m_RenderElement name="order_field_element" prefix="$PrefixSpecial" field="PaymentCCExpDate" title="lu_fld_ExpirationDate"/>
</dl>
<inp2:m_else/>
<dl class="info">
<inp2:m_RenderElement name="order_field_element" prefix="$PrefixSpecial" field="PaymentType"/>
</dl>
</inp2:m_if>
</fieldset>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="order_form">
<div class="cart-detail receipt">
<div class="success-order">
<p class="links">
<a href="javascript:window.print();" class="link-print">Print</a>
<a href="" class="link-download">Download</a>
</p>
<div class="clear"></div>
<p class="green">Thank you for your order #<inp2:ord.last_Field field="OrderNumber"/>!</p>
<p><strong>Below is the receipt / confirmation for your order. Please <a href="">print</a> or <a href="">download</a> it for your records.</strong></p>
<p>You will receive a confirmation once the order is approved and/or shipped.<br />Your credit card was authorized for the amount of your order but will not be charged until the order is approved</p>
</div>
<h1>Order <inp2:ord_Field field="OrderNumber"/></h1>
<inp2:m_if check="OrderHasTangibleItems">
<div class="halfcol">
<inp2:m_RenderElement name="order_form_billing" PrefixSpecial="$PrefixSpecial"/>
</div>
<div class="halfcol halfcol-last">
<inp2:m_RenderElement name="order_form_shipping" PrefixSpecial="$PrefixSpecial"/>
</div>
<inp2:m_else/>
<div>
<inp2:m_RenderElement name="order_form_billing" PrefixSpecial="$PrefixSpecial"/>
</div>
</inp2:m_if>
<div class="clear"></div>
<table class="items">
<thead>
<tr>
<th colspan="2" style="text-align: left;">Items in your order (<inp2:ord_ItemsInCart/>)</th>
<th>Qty.</th>
<th>Price</th>
<th>Total</th>
</tr>
</thead>
<tbody>
<inp2:ListOrderItems render_as="orderitem_elem"/>
</tbody>
</table>
<dl class="total">
<inp2:m_include template="elements/ajax/order_totals" prefix="ord.last"/>
</dl>
<div class="clear"></div>
</div>
</inp2:m_DefineElement>
<!--## MAIN CONTENT ##-->
<inp2:m_DefineElement name="content">
+ <inp2:m_Include template="elements/options.elm" strip_nl="2"/>
<ul class="steps">
<li class="step1"><span><i></i>Shopping Cart</span></li>
<li class="step2"><span><i></i>One-step Checkout</span></li>
<li class="step3 active"><span><i></i>Receipt</span></li>
</ul>
<div class="clear"></div>
<inp2:ord.last_ShowOrder render_as="order_form" />
</inp2:m_DefineElement>
<!--## /MAIN CONTENT ##-->
<!--## DESIGN TEMPLATE ##-->
<inp2:m_include template="designs/default_design.des" pass_params="1"/>
<!--## /DESIGN TEMPLATE ##-->
\ No newline at end of file
Index: branches/1.0.x/products/details.tpl
===================================================================
--- branches/1.0.x/products/details.tpl (revision 15018)
+++ branches/1.0.x/products/details.tpl (revision 15019)
@@ -1,295 +1,297 @@
<!--##
<NAME>Products - Details Design</NAME>
<DESC>General design template for Product Details</DESC>
<SECTION>Pages||Products</SECTION>
##-->
<inp2:p_AddToRecent />
<inp2:m_DefineElement name="page_title"><inp2:p_Field name="Name" html_escape="1"/></inp2:m_DefineElement>
<inp2:m_DefineElement name="sidebar">
<inp2:m_Include template="elements/side_boxes/related_products.elm" data_exists="1"/>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="before_content">
-<div class="block-fixed">
- <div>
- <a href="<inp2:p_AddToCartLink template='elements/ajax/cart_bubble' product_template='__default__'/>" class="button-addtocart" qty_id="product-qty" rel="nofollow"><span><img src="<inp2:m_TemplatesBase/>img/bg-button-cart-add.png" width="24" height="24" alt="" /><i>Add to Cart</i></span></a>
- </div>
-</div>
+ <inp2:m_ifnot check="p_OptionsUpdateMode">
+ <inp2:m_ifnot check="p_FieldEquals" field="OptionsSelectionMode" value="1">
+ <div class="block-fixed">
+ <div>
+ <a href="<inp2:p_AddToCartLink template='elements/ajax/cart_bubble' product_template='__default__'/>" class="button-addtocart" qty_id="product-qty" rel="nofollow"><span><img src="<inp2:m_TemplatesBase/>img/bg-button-cart-add.png" width="24" height="24" alt="" /><i>Add to Cart</i></span></a>
+ </div>
+ </div>
+
+ <script type="text/javascript">
+ $(document).ready(
+ function () {
+ $('.button-addtocart').click(
+ function ($e) {
+ $('#add-to-cart-btn').click();
+
+ return false;
+ }
+ );
+ }
+ );
+ </script>
+ </inp2:m_ifnot>
+ </inp2:m_ifnot>
</inp2:m_DefineElement>
<!--## MAIN CONTENT ##-->
<inp2:m_DefineElement name="content">
<inp2:rev_InitList main_list="1"/>
<div class="block no-border-bottom">
<inp2:m_Include template="elements/navigation_bar.elm" navigation_buttons="1"/>
<div class="goods border-radius product-detail">
<inp2:m_if check="p_Field" name="IsNew" db="db">
<div class="ribbon new"></div>
<inp2:m_elseif check="p_Field" name="IsPop" db="db"/>
<div class="ribbon top"></div>
<inp2:m_elseif check="p_Field" name="Featured" db="db"/>
<div class="ribbon sale"></div>
</inp2:m_if>
<h1><inp2:p_Field field="Name" html_escape="1"/></h1>
<div class="rating">
<inp2:p_VotesIndicator/>
<!--<inp2:m_if check="p_Field" name="CachedRating" equals_to="1|2|3|4|5" db="db">
<img src="<inp2:m_TemplatesBase/>img/star-small.jpg" width="18" height="18" alt="" />
</inp2:m_if>
<inp2:m_if check="p_Field" name="CachedRating" equals_to="2|3|4|5" db="db">
<img src="<inp2:m_TemplatesBase/>img/star-small.jpg" width="18" height="18" alt="" />
</inp2:m_if>
<inp2:m_if check="p_Field" name="CachedRating" equals_to="3|4|5" db="db">
<img src="<inp2:m_TemplatesBase/>img/star-small.jpg" width="18" height="18" alt="" />
</inp2:m_if>
<inp2:m_if check="p_Field" name="CachedRating" equals_to="4|5" db="db">
<img src="<inp2:m_TemplatesBase/>img/star-small.jpg" width="18" height="18" alt="" />
</inp2:m_if>
<inp2:m_if check="p_Field" name="CachedRating" equals_to="5" db="db">
<img src="<inp2:m_TemplatesBase/>img/star-small.jpg" width="18" height="18" alt="" />
</inp2:m_if>-->
</div>
<div class="h1-reviews">(<a href="#reviews"><inp2:rev_TotalRecords/> reviews</a>)</div>
<div class="clear"></div>
<div class="product">
<div class="info">
<div class="img">
<p class="signsmall">Roll over images for multiple views:</p>
<ul id="pikame" >
<inp2:m_if check="p_ImageSrc">
<li><img src="<inp2:p_ImageSrc format="resize:256x258;wm:img/logo_watermark.png|-1|-1"/>" width="256" height="258" alt="" /></li>
</inp2:m_if>
<inp2:m_if check="p_HasAdditionalImages">
<inp2:m_DefineElement name="additional_image_element">
<li><img src="<inp2:ImageSrc format="resize:256x258;wm:img/logo_watermark.png|-1|-1"/>" width="256" height="258" alt="" /></li>
</inp2:m_DefineElement>
<inp2:p_ListImages render_as="additional_image_element" types="additional" per_page="-1" no_table="1" MaxWidth="256" DefaultWidth="256" DefaultImage="img/no_picture.gif"/>
</inp2:m_if>
</ul>
<div class="viewlarger">
<a href="" onclick="TINY.box.show({image:'<inp2:p_ImageSrc format="resize:800x600;wm:img/logo_watermark.png|-1|-1"/>',animate:true}); return false;">View Larger</a>
</div>
<p class="showmore"><a href="#">Show More Images...</a></p>
</div>
<div class="doplinks">
<a href="#" class="link-print">Print this Page</a><br />
<inp2:m_if check="p_InCompare">
<a href="#" class="link-compare" added="1">Remove from Comparison List</a><br />
<inp2:m_else/>
<a href="#" class="link-compare" added="0">Compare to other Products</a><br />
</inp2:m_if>
<a href="#" class="link-wishlist">Add to Wishlist</a><br />
</div>
</div>
<div class="description">
- <div class="options-har">
- <div class="sel-options">
- <label><strong>Select Size:</strong>
- <select name="select" class="field-alt">
- <option value="" selected="selected">22"</option>
- <option value="">23"</option>
- </select>
- </label>
+ <inp2:m_if check="p_ShouldListOptions">
+ <inp2:m_Include template="elements/ajax/product_options"/>
+ <inp2:m_else/>
+ <div class="price-block">
+ <p><s class="under"><inp2:p_Field name="MSRP" currency="selected" decimal_tag="span"/></s></p>
+ <p class="redprice"><em class="price"><inp2:p_Field name="Price" currency="selected" decimal_tag="span"/></em></p>
</div>
- <div class="sel-options">
- <label><strong>Select Color:</strong>
- <select name="select" class="field-alt">
- <option value="" selected="selected">Gray Metallic</option>
- <option value="">White Metallic</option>
- <option value="">Black Metallic</option>
- </select>
- </label>
+ <div class="order-block">
+ <p class="qty form"><strong>Qty.</strong>&nbsp;&nbsp;<input type="text" name="qty" id="product-qty" value="1" class="field" /></p>
+ <p class="but"><a href="<inp2:p_AddToCartLink template='elements/ajax/cart_bubble' product_template='__default__'/>" class="addtocart" id="add-to-cart-btn" qty_id="product-qty" rel="nofollow"><span><i>Add to Cart</i></span></a></p>
+ <p class="avail">Availability: <em><inp2:m_if check="p_Available">In Stock<inp2:m_else/>Not In Stock</inp2:m_if></em></p>
</div>
- <div class="clear"></div>
- </div>
+ </inp2:m_if>
- <div class="price-block">
- <p><s class="under"><inp2:p_Field name="MSRP" currency="selected" decimal_tag="span"/></s></p>
- <p class="redprice"><em class="price"><inp2:p_Field name="Price" currency="selected" decimal_tag="span"/></em></p>
- </div>
- <div class="order-block">
- <p class="qty form"><strong>Qty.</strong>&nbsp;&nbsp;<input type="text" name="qty" id="product-qty" value="1" class="field" /></p>
- <p class="but"><a href="<inp2:p_AddToCartLink template='elements/ajax/cart_bubble' product_template='__default__'/>" class="addtocart" qty_id="product-qty" rel="nofollow"><span><i>Add to Cart</i></span></a></p>
- <p class="avail">Availability: <em>In Stock</em></p>
- </div>
<div class="clear"></div>
<dl class="har">
<dt>Model:</dt>
<dd>XT2324</dd>
<dt>Manufacturer:</dt>
<dd><inp2:p_Field name="ManufacturerId"/></dd>
</dl>
<dl class="har har_right">
<dt>SKU:</dt>
<dd><inp2:p_Field name="SKU"/></dd>
<dt>Size:</dt>
<dd>22''</dd>
</dl>
<div class="clear"></div>
<div class="text">
</div>
<div id="tabs">
<ul>
<inp2:m_if check="p_Field" name="cust_Features">
<li><a href="#tabs-1">Features</a></li>
</inp2:m_if>
<inp2:m_if check="p_Field" name="Description">
<li><a href="#tabs-2">Details</a></li>
</inp2:m_if>
<li><a href="#tabs-3">Specifications</a></li>
</ul>
<inp2:m_if check="p_Field" name="cust_Features">
<div id="tabs-1">
<inp2:p_Field name="cust_Features"/>
</div>
</inp2:m_if>
<inp2:m_if check="p_Field" name="Description">
<div id="tabs-2">
<inp2:p_Field name="Description"/>
</div>
</inp2:m_if>
<div id="tabs-3">
<p>Mauris eleifend est et turpis. Duis id erat. Suspendisse potenti. Aliquam vulputate, pede vel vehicula accumsan, mi neque rutrum erat, eu congue orci lorem eget lorem. Vestibulum non ante. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce sodales. Quisque eu urna vel enim commodo pellentesque. Praesent eu risus hendrerit ligula tempus pretium. Curabitur lorem enim, pretium nec, feugiat nec, luctus a, lacus.</p>
<p>Duis cursus. Maecenas ligula eros, blandit nec, pharetra at, semper at, magna. Nullam ac lacus. Nulla facilisi. Praesent viverra justo vitae neque. Praesent blandit adipiscing velit. Suspendisse potenti. Donec mattis, pede vel pharetra blandit, magna ligula faucibus eros, id euismod lacus dolor eget odio. Nam scelerisque. Donec non libero sed nulla mattis commodo. Ut sagittis. Donec nisi lectus, feugiat porttitor, tempor ac, tempor vitae, pede. Aenean vehicula velit eu tellus interdum rutrum. Maecenas commodo. Pellentesque nec elit. Fusce in lacus. Vivamus a libero vitae lectus hendrerit hendrerit.</p>
</div>
</div>
</div>
<div class="clear"></div>
</div>
<div class="reviews">
<a name="reviews"></a>
<div class="top-review">
<div class="info-review">
<p class="title">Reviews for <inp2:p_Field name="Name" html_escape="1" cut_first="60"/> (<inp2:rev_TotalRecords/>):</p>
<!--<p class="but-review"><a href="" onclick="TINY.box.show({iframe:'addreview-success.html',width:600,height:340}); return false;" class="addreview">Add a Review</a></p>-->
<p class="but-review"><a href="<inp2:p_ProductLink template='elements/ajax/add_review' width='600' height='340'/>" class="thickbox addreview">Add a Review</a></p>
<div class="sortby">
Sort by:
<select>
<option value="" selected="selected">Price</option>
<option value="">Rating</option>
<option value="">Populate</option>
</select>
</div>
</div>
<div class="overall-review">
<p>Overall Rating:</p>
<div class="overall-detail">
<inp2:rev_PrintRatingPercents render_as="rating_percent_element" show_none="0"/>
</div>
</div>
<div class="clear"></div>
</div>
<inp2:rev_PrintList render_as="review_element"/>
<script type="text/javascript">
$(document).ready(
function () {
$('.reviews .row-review').each(
function () {
var $review = $(this);
$('.yes, .no', this).click(
function ($e) {
var $link = $(this),
$counter = $('.' + $link.attr('class') + '-count', $review);
$.get(
$link.attr('href'),
function ($count) {
$counter.html('(' + $count + ')');
}
)
return false;
}
);
}
);
}
);
</script>
</div>
<div class="clear"></div>
<inp2:m_Include template="elements/pagination.elm" prefix="rev"/>
</div>
</div>
</inp2:m_DefineElement>
<!--## /MAIN CONTENT ##-->
<inp2:m_DefineElement name="add_to_head">
<script src="<inp2:m_TemplatesBase />inc/js/jquery.gzoom.js"></script>
<script src="<inp2:m_TemplatesBase />inc/js/jquery.pikachoose.full.js"></script>
<script type= "text/javascript">
$(document).ready(
function() {
$('#tabs').tabs();
$('#pikame').PikaChoose({autoPlay:false, showCaption:false});
$('.link-compare').click(
function ($e) {
var $me = $(this),
$added = $me.attr('added') == '1';
compare_product(
<inp2:p_Field name="ProductId"/>,
!$added,
function ($data) {
$added = !$added;
$me
.attr('added', $added ? '1' : '0')
.html($added ? 'Remove from Comparison List' : 'Compare to other Products');
}
);
return false;
}
);
}
);
window.onload = function () {
$('#zoom').gzoom({
sW: 258,
sH: 258,
lW: 1400,
lH: 1050,
lighbox : false
});
};
</script>
</inp2:m_DefineElement>
<!--## DESIGN TEMPLATE ##-->
<inp2:m_include template="designs/default_design.des" pass_params="1" right_column="sidebar" before_content="before_content"/>
<!--## /DESIGN TEMPLATE ##-->
\ No newline at end of file
Index: branches/1.0.x/products/compare.tpl
===================================================================
--- branches/1.0.x/products/compare.tpl (revision 15018)
+++ branches/1.0.x/products/compare.tpl (revision 15019)
@@ -1,196 +1,204 @@
<!--##
<NAME>Compare Products</NAME>
<DESC>Product comparison page</DESC>
<SECTION>Pages||Compare Products</SECTION>
##-->
<inp2:m_DefineElement name="page_title"><inp2:st_PageInfo type="htmlhead_title" html_escape="1"/></inp2:m_DefineElement>
<!--## MAIN CONTENT ##-->
<inp2:m_DefineElement name="content">
<inp2:p_InitList list_name="compare_products" types="compare" parent_cat_id="any" per_page="3"/>
<inp2:m_ifnot check="p_TotalRecords" list_name="compare_products">
<inp2:p_ContinueLink redirect="1"/>
</inp2:m_ifnot>
<div class="block no-border-bottom">
<h2><em>Comparing Products (<abbr id="product-count"><inp2:p_TotalRecords list_name="compare_products"/></abbr>)</em><span></span></h2>
<div class="compare border-radius">
<inp2:m_DefineElement name="product_compare_header">
<div class="good-item" product_id="<inp2:Field name='ProductId'/>" position="<inp2:m_Param name='num'/>">
<div class="button-delete"><a href="#"><img src="<inp2:m_TemplatesBase/>img/icon-delete.png" width="13" height="13" alt="" /></a></div>
<dl>
<dt><a href="<inp2:ProductLink template='__default__'/>"><inp2:Field name="Name"/></a></dt>
<dd>
<p class="img">
<a href="<inp2:ProductLink template='__default__'/>">
<inp2:Image render_as="image_element" Primary="1" Thumbnail="1" DefaultImage="img/no_picture.gif" MaxWidth="136" MaxHeight="136"/>
</a>
</p>
<p class="price"><inp2:Field name="Price" currency="selected" decimal_tag="span"/></p>
- <p><a href="<inp2:AddToCartLink template='elements/ajax/cart_bubble' product_template='__default__'/>" class="addtocart" rel="nofollow"><span>Add to Cart</span></a></p>
+ <p>
+ <a href="<inp2:AddToCartLink template='elements/ajax/cart_bubble' product_template='__default__'/>" class="addtocart" rel="nofollow">
+ <inp2:m_if check="Field" name="HasRequiredOptions" db="db">
+ <span>Click to See</span>
+ <inp2:m_else/>
+ <span>Add to Cart</span>
+ </inp2:m_if>
+ </a>
+ </p>
</dd>
</dl>
<div class="rating">
<p>
<inp2:VotesIndicator small_style="small-star"/>
</p>
<p><a href="<inp2:ProductLink template='__default__' anchor='reviews'/>">Reviews</a> (<a href="<inp2:ProductLink template='__default__' anchor='reviews'/>"><inp2:Field name="CachedReviewsQty"/></a>)</p>
</div>
<dl class="har">
<dt>Model:</dt>
<dd>XT2324</dd>
<inp2:m_if check="p_Field" name="ManufacturerId" db="db">
<dt>Manufacturer:</dt>
<dd><inp2:Field name="ManufacturerId"/></dd>
</inp2:m_if>
<dt>SKU:</dt>
<dd><inp2:Field name="SKU"/></dd>
<dt>Size:</dt>
<dd>22''</dd>
</dl>
</div>
</inp2:m_DefineElement>
<inp2:p_PrintList render_as="product_compare_header" list_name="compare_products"/>
<div id="add-product" class="good-item last-child" <inp2:m_ifnot check="p_TotalRecords" list_name="compare_products" equals_to="0|1|2"> style="display: none;"</inp2:m_ifnot>>
<p class="buttons-block"><a href="<inp2:p_ContinueLink/>" class="compare-button"><span><img src="<inp2:m_TemplatesBase/>img/bg-button-compare-add.png" width="24" height="24" alt="" /><br />Select Product<br />to Compare</span></a></p>
</div>
<div class="clear"></div>
<div id="compare-menu" style="width: 678px;">
<inp2:m_if check="p_HasCompareField" name="Description" list_name="compare_products">
<h3><a href="#">Description</a></h3>
<div>
<inp2:m_DefineElement name="product_compare_description">
<div class="good-item-cell">
<div class="description">
<p><inp2:Field name="Description"/></p>
</div>
</div>
</inp2:m_DefineElement>
<inp2:p_PrintList render_as="product_compare_description" list_name="compare_products"/>
<div class="clear"></div>
</div>
</inp2:m_if>
<inp2:m_if check="p_HasCompareField" name="cust_Features" list_name="compare_products">
<h3><a href="#">Features</a></h3>
<div>
<inp2:m_DefineElement name="product_compare_features">
<div class="good-item-cell">
<div class="description">
<p><inp2:Field name="cust_Features"/></p>
</div>
</div>
</inp2:m_DefineElement>
<inp2:p_PrintList render_as="product_compare_features" list_name="compare_products"/>
<div class="clear"></div>
</div>
</inp2:m_if>
<!--<h3><a href="#">Details</a></h3>
<div></div>
<h3><a href="#">Specifications</a></h3>
<div></div>
<h3><a href="#">Overall Rating</a></h3>
<div></div>-->
<inp2:m_if check="p_HasCompareField" name="CachedReviewsQty" list_name="compare_products">
<h3><a href="#">Reviews</a></h3>
<div>
<inp2:m_DefineElement name="product_compare_reviews">
<div class="good-item-cell">
<div class="description">
<p class="reviews">
<inp2:m_DefineElement name="short_review_element">
<div class="row-review">
<p class="user"><inp2:Field name="ReviewedBy"/></p>
<div class="text-review"><inp2:Field name="ReviewText"/></div>
</div>
</inp2:m_DefineElement>
<inp2:rev_PrintList render_as="short_review_element" per_page="-1" requery="1"/>
</p>
</div>
</div>
</inp2:m_DefineElement>
<inp2:p_PrintList render_as="product_compare_reviews" list_name="compare_products"/>
<div class="clear"></div>
</div>
</inp2:m_if>
</div>
<div class="clear"></div>
</div>
</div>
</inp2:m_DefineElement>
<!--## /MAIN CONTENT ##-->
<inp2:m_DefineElement name="add_to_head">
<script type= "text/javascript">
$(document).ready(
function() {
var icons = {header: 'ui-icon-circle-arrow-e', headerSelected: 'ui-icon-circle-arrow-s'};
$( '#compare-menu' ).accordion({
icons: icons,
autoHeight: false,
navigation: true
});
$('.button-delete').click(
function ($e) {
var $me = $(this),
$header = $me.parent(),
$position = $header.attr('position');
compare_product($header.attr('product_id'), false);
$header.remove();
$('h3', '#compare-menu').next('div').each(
function () {
$('.good-item-cell:nth-child(' + $position + ')', this).remove();
}
);
$('#product-count').html( parseInt($('#product-count').text()) - 1 );
// renumber positions, since they were shifted
var $index = 1;
$('.button-delete').parent().each(
function () {
$(this).attr('position', $index++);
}
);
$('#add-product').show();
return false;
}
);
}
);
</script>
</inp2:m_DefineElement>
<!--## DESIGN TEMPLATE ##-->
<inp2:m_include template="designs/default_design.des" pass_params="1"/>
<!--## /DESIGN TEMPLATE ##-->
\ No newline at end of file
Index: branches/1.0.x/inc/js/jquery.scripts.js
===================================================================
--- branches/1.0.x/inc/js/jquery.scripts.js (revision 15018)
+++ branches/1.0.x/inc/js/jquery.scripts.js (revision 15019)
@@ -1,293 +1,309 @@
var $auto_search_request = null;
/* === General usage functions === */
function jq($selector, $delimiter) {
return ($selector + '').replace(new RegExp('[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\' + ($delimiter || '') + '-]', 'g'), '\\$&');
}
function in_array(needle, haystack)
{
return array_search(needle, haystack) != -1;
}
function array_search(needle, haystack)
{
for (var i=0; i<haystack.length; i++)
{
if (haystack[i] == needle) return i;
}
return -1;
}
Array.prototype.diff = function(a) {
return this.filter(
function (i) {
return a.indexOf(i) == -1;
}
);
};
function get_control($mask, $field, $append, $prepend) {
$append = $append !== undefined ? '_' + $append : '';
$prepend = $prepend !== undefined ? $prepend + '_' : '';
return document.getElementById( $prepend + $mask.replace('#FIELD_NAME#', $field) + $append );
}
function update_checkbox_options($cb_mask, $hidden_id, $form_selector)
{
var $tmp = '',
$kf = $($form_selector !== undefined ? $form_selector : '#' + $form_name).get(0);
for (var i = 0; i < $kf.elements.length; i++) {
if ( $kf.elements[i].id.match($cb_mask) ) {
if ($kf.elements[i].checked) {
$tmp += '|'+$kf.elements[i].value;
}
}
}
if ($tmp.length > 0) {
$tmp += '|';
}
document.getElementById($hidden_id).value = $tmp.replace(/,$/, '');
}
function watch_anchor () {
var $last_anchor = '';
setInterval(
function () {
if (window.location.hash != $last_anchor) {
$last_anchor = window.location.hash;
var $new_anchor = $last_anchor ? $last_anchor.substring(1) : '';
$('body').trigger('anchorchanged', [$new_anchor]);
}
}, 100
);
}
function sort_object($object) {
// Setup Arrays
var $sorted_keys = [], $sorted_object = {};
for (var $property_name in $object) {
$sorted_keys.push($property_name);
}
$sorted_keys.sort();
$($sorted_keys).each(
function () {
$sorted_object[this] = $object[this];
}
);
return $sorted_object;
}
function compare_product($product_id, $compare_event, $callback) {
if ( $compare_event === undefined || $compare_event === true ) {
$compare_event = 'OnAddToCompare';
}
else if ( $compare_event === false ) {
$compare_event = 'OnRemoveFromCompare';
}
var $url = FormManager.getURL('p', 'elements/side_boxes/compare.elm', $compare_event);
$.get(
$url,
{'p_id': $product_id},
function ($data) {
$('#compare-products-sidebox').replaceWith($data);
if ( $callback !== undefined && $.isFunction($callback) ) {
$callback($data);
}
}
);
return false;
}
function redirect($url)
{
window.location.href = $url;
}
function search_on_change ($e) {
if ($auto_search_request != null) {
$auto_search_request.abort();
}
if ( $e.which == 13 || $.trim( $('#search-box-small-input').val() ).length < 3 ) {
$('.search-box-small-results').hide();
return ;
}
var $form = $('#search_form');
$auto_search_request = $.get(
$form.attr('action'),
$form.serialize(),
function ($data) {
$('.search-box-small-header').html($data);
if ( $.trim($data) != '' ) {
$('.search-box-small-results').show();
}
else {
$('.search-box-small-clear').click();
}
}
);
}
/* === DBlocks class === */
function DBlocks() {
var $me = this;
this.selectors = ['#lang', '#currency', '#login', /*'#login-alt',*/ '#profile'];
$(document).ready(
function () {
$me.init();
}
);
}
DBlocks.prototype.init = function () {
var $manager = this;
$( this.selectors.join(', ') ).unbind('click').click(
function($e, $now) {
var $me = $(this),
$parent = $me.parent();
if ( $parent.is('.plashka-sel') ) {
$parent.removeClass('plashka-sel');
if ( $now === undefined || $now === false ) {
$('#' + $me.attr('id') + '-sel').fadeOut();
}
else {
$('#' + $me.attr('id') + '-sel').hide();
}
}
else {
$manager.hideOthers($me);
$parent.addClass('plashka-sel');
$('#' + $me.attr('id') + '-sel').fadeIn();
}
return false;
}
);
$('.icon-close').click(
function() {
$('#login').parent().removeClass('plashka-sel'); // ,#login-alt
$('#login-sel').fadeOut(); // , #login-alt-sel
return false;
}
);
}
DBlocks.prototype.hideOthers = function ($current) {
$( this.selectors.join(', ') ).not($current).each(
function () {
var $me = $(this),
$parent = $me.parent();
if ( $parent.is('.plashka-sel') ) {
$me.trigger('click', [true]);
}
}
);
}
/* === RatingManager class === */
function RatingManager ($url) {
this.Url = $url;
}
RatingManager.prototype.makeVote = function ($vote, $prefix, $id, $size) {
var $url = this.Url.replace('#PREFIX#', $prefix).replace('#VOTE#', $vote).replace('#ID#', $id).replace('#SIZE#', $size);
$.get(
$url,
function ($response) {
if ($response.substring(0, 5) == '@err:') {
alert( $response.substring(5) );
return ;
}
document.getElementById('page_rating_' + $id).innerHTML = $response;
}
)
}
function add_to_cart_handler() {
var $me = $(this),
- $qty = $me.attr('qty_id') !== undefined ? parseInt($('#' + $me.attr('qty_id')).val()) : 1;
+ $qty = $me.attr('qty_id') !== undefined ? get_cart_qty('#' + $me.attr('qty_id')) : 1,
+ $url = $me.attr('href');
+ if ( $url.indexOf('bubble') == -1 ) {
+ // proceed with regular redirect
+ return true;
+ }
if ( $me.hasClass('addedtocart') ) {
// disabled button
return false;
}
- if ( isNaN($qty) ) {
- $qty = 1;
- }
-
- var $bubble = $('.basketStatus'),
- $timer_id = $bubble.data('hide_timer');
+ var $timer_id = $('.basketStatus').data('hide_timer');
clearTimeout($timer_id);
$.get(
- $me.attr('href') + '&qty=' + $qty,
+ $url + '&qty=' + $qty,
function ($bubble_content) {
- $('.basketContent', $bubble).html( $bubble_content.replace(/#QTY#/g, $qty) );
- $bubble
- .stop(true, true)
- .fadeIn(
- 'slow',
- function () {
- var $timer = setTimeout(function(){ $bubble.fadeOut('slow'); }, 2000);
- $bubble.data('hide_timer', $timer);
- }
- );
+ display_cart_bubble($bubble_content, $qty);
if ( $me.hasClass('addtocart') ) {
$me.removeClass('addtocart').addClass('addedtocart').html('Added to Cart');
}
}
);
return false;
}
+function get_cart_qty ($qty_selector) {
+ var $ret = parseInt( $($qty_selector).val() );
+
+ if ( isNaN($ret) ) {
+ $ret = 1;
+ }
+
+ return $ret;
+}
+
+function display_cart_bubble ($bubble_content, $qty) {
+ var $bubble = $('.basketStatus');
+
+ $('.basketContent', $bubble).html( $bubble_content.replace(/#QTY#/g, $qty) );
+ $bubble
+ .stop(true, true)
+ .fadeIn(
+ 'slow',
+ function () {
+ var $timer = setTimeout(function(){ $bubble.fadeOut('slow'); }, 2000);
+ $bubble.data('hide_timer', $timer);
+ }
+ );
+}
+
/* === Startup === */
$(document).ready(
function() {
watch_anchor();
$('#change-password').click(
function($e) {
$('#password-show').hide();
$('#password-block').fadeIn();
return false;
}
);
- $('.addtocart, .button-addtocart').click(add_to_cart_handler);
+ $('.addtocart').click(add_to_cart_handler);
}
);
\ No newline at end of file
Index: branches/1.0.x/inc/js/cart_manager.js
===================================================================
--- branches/1.0.x/inc/js/cart_manager.js (revision 15018)
+++ branches/1.0.x/inc/js/cart_manager.js (revision 15019)
@@ -1,603 +1,608 @@
function ShopCartManager( $settings ) {
this.updateUrl = '';
this.orderInfo = {};
this.constants = {};
this.currencyMask = '%s';
this.debugMode = false;
$.extend(this, $settings);
this.rowTimers = {};
var $me = this;
$(document).ready(
function () {
$me.init();
}
);
}
ShopCartManager.prototype.init = function () {
var $me = this;
this.process(this.orderInfo);
$('.delete-cart-link').click(
function ($e) {
var $order_item_id = $(this).parents('tr:first').attr('order_item_id');
$me.apply( [{name: 'delete_id', value: $order_item_id}] );
return false;
}
);
$('.product-qty:input', '#shopping-cart-form')
.blur(
function ($e) {
var $row_index = $(this).parents('tr[row_index]:first').attr('row_index');
if ( $me.debugMode ) {
console.log('blur on ', $row_index, ' row');
}
$me.clearRowTimers($row_index);
if ( $me.debugMode ) {
console.log('doing apply (from blur) on ', $row_index, ' row');
}
$me.apply();
return false;
}
)
.keyup(
function ($e) {
var $row_index = $(this).parents('tr[row_index]:first').attr('row_index');
if ( $me.debugMode ) {
console.log('keyup on ', $row_index, ' row');
}
$me.clearRowTimers($row_index);
$me.rowTimers[$row_index] = setTimeout(
function() {
if ( $me.debugMode ) {
console.log('doing apply (from keyup) on ', $row_index, ' row');
}
$me.apply();
}
, 2000
);
}
);
$('#remove-coupon').click(
function ($e) {
$me.apply( [{name: 'remove', value: 'coupon'}] );
return false;
}
);
$('#remove-gift-certificate').click(
function ($e) {
$me.apply( [{name: 'remove', value: 'gift_certificate'}] );
return false;
}
);
$('#update-cart, #apply-coupon, #apply-gift-certificate').click(
function ($e) {
$me.apply();
return false;
}
);
}
ShopCartManager.prototype.clearRowTimers = function ($row_index) {
if ( this.rowTimers[$row_index] !== undefined ) {
if ( this.debugMode ) {
console.log('cleartimers on ', $row_index, ' row -> found = delete');
}
clearTimeout(this.rowTimers[$row_index]);
delete this.rowTimers[$row_index];
}
else if ( this.debugMode ) {
console.log('cleartimers on ', $row_index, ' row -> not found = skip');
}
}
ShopCartManager.prototype.apply = function ($params) {
var $me = this;
$.post(
this.updateUrl,
this.getFormData($params),
function ($data) {
$data = eval('(' + $data + ')');
$me.process($data);
}
)
}
ShopCartManager.prototype.getFormData = function ($params) {
var $ret = $('#shopping-cart-form').serializeArray();
if ( $params !== undefined ) {
while( $params.length > 0 ) {
$ret.push( $params.shift() );
}
}
return $ret;
}
ShopCartManager.prototype.process = function ($data) {
// 1. row missing ajax response -> was deleted in db
// 2. row missing in HTML -> was added in db
var $me = this,
$old_rows = this.getOldRows(),
$new_rows = this.getNewRows($data),
$add_rows = $new_rows.diff($old_rows),
$delete_rows = $old_rows.diff($new_rows);
if ( this.debugMode ) {
console.log('proessing data: ', $data);
}
// add rows
$($add_rows).each(
function () {
$me.addRow( this, $data.items[this] );
}
);
// delete rows
$($delete_rows).each(
function () {
- var $row = $me.getRowByIndex(this);
+ var $row = $me.getRowByIndex(this),
+ $options_row = $row.next();
// $row.next('tr.separator').remove();
$row.remove();
+
+ if ( $('td.options-td', $options_row).length == 1 ) {
+ $options_row.remove();
+ }
}
);
this.updateExistingRows($data);
this.showErrors($data);
this.showFooter($data);
if ( this.debugMode ) {
console.log('old: ', $old_rows, '; new: ', $new_rows, '; add: ', $add_rows, '; delete: ', $delete_rows);
}
}
ShopCartManager.prototype.addRow = function ($row_index, $row_data) {
if ( this.debugMode ) {
console.log('adding row: ', $row_data);
}
var $html = $('#product-row-mask').val(),
$value = '';
/*f: OrderItemId ; v: 101
f: ProductName ; v: Product With Stock Limit = 5; with backorder
f: BackOrderFlag ; v: 1
f: FlatPrice ; v: 2
f: Price ; v: 1.2308
f: Quantity ; v: 2
f: Virtual ; v: 0
f: cust_Availability ; v:*/
for (var $field in $row_data.fields) {
$value = $row_data.fields[$field];
if ( $field == 'Price' || $field == 'FlatPrice' ) {
$value = this.formatPrice($value);
}
$html = $html.replace(new RegExp('{field:' + $field + '}', 'g'), $value);
if ( this.debugMode ) {
console.log('f: ', $field, '; v: ', $value);
}
}
$html = $html.replace(/{ROW_INDEX}/g, $row_index);
// $html = $html.replace(/{DISCOUNT}/g, $row_index);
// $html = $html.replace(/{EXTENDED_PRICE}/g, $row_index);
// var $separator = $( $('#product-row-separator-mask').val() );
$('.shop-cart-row:last').after($html);
/*$('.shop-cart-row:last').after($separator);
$separator.after($html);*/
}
ShopCartManager.prototype.updateExistingRows = function ($data) {
if ( $.isArray($data.items) ) {
// todo: hide empty shopping cart & show special message
$('#item-count').html(0);
return;
}
var $row_count = 0;
for (var $row_index in $data.items) {
var $fields = $data.items[$row_index].fields,
$discount = $fields['FlatPrice'] - $fields['Price'],
$product_row = this.getRowByIndex($row_index),
$discount_container = $('.product-discount', $product_row);
// update product title
var $product_with_link = $('.product-with-link', $product_row);
$('a:first', $product_with_link)
.attr('href', $data.items[$row_index].product_url)
.html($fields['ProductName']);
$product_with_link.toggle( $fields['Virtual'] == 0 );
$('.product-without-link', $product_row)
.toggle( $fields['Virtual'] == 1 )
.html($fields['ProductName']);
$('.free-shipping', $product_row).toggle( $data.items[$row_index].free_promo_shipping );
$('.back-order-mark', $product_row).toggle( $fields['BackOrderFlag'] > 0 );
$('.product-availability', $product_row)
.toggle( $fields['cust_Availability'] != '' )
.html('<br/>' + $fields['cust_Availability']);
$('.product-qty.read-only', $product_row).toggle( $fields['Type'] != this.constants['PRODUCT_TYPE_TANGIBLE'] );
$('.product-qty:not(.read-only)', $product_row).toggle( $fields['Type'] == this.constants['PRODUCT_TYPE_TANGIBLE'] );
// update product specific discount
$('.item-price', $discount_container).html( this.formatPrice($fields['FlatPrice']) );
$('.item-discount', $discount_container).html( '- ' + this.formatPrice($discount) );
$discount_container.toggle( $discount > 0 );
// update product prices
$('.price-cell', $product_row).html( this.formatPrice($fields['Price']) );
$('.extended-price-cell', $product_row).html( this.formatPrice($fields['Quantity'] * $fields['Price']) );
$row_count++;
}
$('#item-count').html($row_count);
}
ShopCartManager.prototype.showErrors = function ($data) {
var $error_code = 0, $error_info = [],
$row_index = '', $field = '',
$tooltip_options = '',
$coupon_error_code = this.getErrorByType('OrderCheckoutErrorType::COUPON', $data),
$gift_certificate_error_code = this.getErrorByType('OrderCheckoutErrorType::GIFT_CERTIFICATE', $data),
$discount_error_code = this.getErrorByType('OrderCheckoutErrorType::DISCOUNT', $data);
if ( $.isArray($data.errors) ) {
// when no error, then it's array
return ;
}
if ( $coupon_error_code ) {
if ( $coupon_error_code == this.constants['OrderCheckoutError::COUPON_APPLIED'] ) {
var $input = $('.coupon-name', '#coupon-row');
}
else {
var $input = $('.coupon-code:input', '#coupon-row');
}
$tooltip_options = this.getCouponErrorOptions($coupon_error_code);
if ( $tooltip_options ) {
this.createTooltip($input, $tooltip_options);
}
}
if ( $gift_certificate_error_code ) {
if ( $gift_certificate_error_code == this.constants['OrderCheckoutError::GC_APPLIED'] ) {
var $input = $('.gift-certificate-discount', '#gift-certificate-row');
}
else {
var $input = $('.gift-certificate-code:input', '#gift-certificate-row');
}
$tooltip_options = this.getGiftCertificateErrorOptions($gift_certificate_error_code);
if ( $tooltip_options ) {
this.createTooltip($input, $tooltip_options);
}
}
if ( $discount_error_code ) {
$input = $('#sub-total');
$tooltip_options = this.getDiscountErrorOptions($discount_error_code);
if ( $tooltip_options ) {
this.createTooltip($input, $tooltip_options);
}
}
for (var $error_type in $data.errors) {
$tooltip_options = '';
$error_info = $error_type.split(':');
$error_code = parseInt( $data.errors[$error_type] );
if ( $error_info[0] == this.constants['OrderCheckoutErrorType::PRODUCT'] ) {
this.processProductError($error_info, $error_code, $data);
}
if ( this.debugMode ) {
console.log('error_type: ', $error_type, '; error_code: ', $error_code, '; row_index: ', $row_index, '; field: ', $field);
}
}
}
ShopCartManager.prototype.showFooter = function ($data) {
var $discount_total = $data.order['DiscountTotal'];
// update "Total Savings"
$('#discount-row').toggle( $discount_total > 0 );
$('.price2', '#discount-row').html( this.formatPrice($discount_total) );
// update Coupon Info
if ( $data.order['CouponId'] == 0 ) {
$('.coupon-code', '#coupon-row').val('');
}
$('.used', '#coupon-row').toggle( $data.order['CouponId'] > 0 );
$('.not-used', '#coupon-row').toggle( $data.order['CouponId'] == 0 );
$('.coupon-name', '#coupon-row').html( $data.order['CouponName'] );
// update Gift Certificate Info
if ( $data.order['GiftCertificateId'] == 0 ) {
$('.gift-certificate-code', '#gift-certificate-row').val('');
}
$('.used', '#gift-certificate-row').toggle( $data.order['GiftCertificateId'] > 0 );
$('.not-used', '#gift-certificate-row').toggle( $data.order['GiftCertificateId'] == 0 );
$('.gift-certificate-discount', '#gift-certificate-row').html( this.formatPrice($data.order['GiftCertificateDiscount']) );
// update "subtotal"
$('#sub-total').html( this.formatPrice($data.order['SubTotal']) );
// update page header
$('#header-items-in-cart').html( $data.order['ItemsInCart'] );
$('#header-cart-subtotal').html( this.formatPrice($data.order['SubTotal'], 'i') );
}
ShopCartManager.prototype.processProductError = function ($error_info, $error_code, $data) {
var $error_type = $error_info.shift(),
$field = $error_info.pop(),
$row_index = $error_info.join(':');
if ( this.getRowByIndex($row_index).length == 0 ) {
// row was deleted
return ;
}
if ( $field == 'Quantity' ) {
var $input = $('.product-qty:input', this.getRowByIndex($row_index)),
$allow_qty_replace = [
this.constants['OrderCheckoutError::FIELD_UPDATE_SUCCESS'],
this.constants['OrderCheckoutError::QTY_CHANGED_TO_MINIMAL']
];
if ( in_array($error_code, $allow_qty_replace) && $input.val() != $data.items[$row_index]['fields']['Quantity'] ) {
// qty changed during ord:OnRecalculateItems
$input.val( $data.items[$row_index]['fields']['Quantity'] );
}
$tooltip_options = this.getQtyErrorOptions($error_code);
if ( $tooltip_options ) {
this.createTooltip($input, $tooltip_options);
}
}
}
ShopCartManager.prototype.getErrorByType = function ($contant_name, $data) {
var $error_type = this.constants[$contant_name];
return $data.errors[$error_type] !== undefined ? $data.errors[$error_type] : false;
}
ShopCartManager.prototype.getRowByIndex = function ($row_index) {
return $("tr.shop-cart-row[row_index='" + $row_index + "']", '#shop-cart-table');
}
ShopCartManager.prototype.getOldRows = function () {
var $ret = [];
$('tr.shop-cart-row', '#shop-cart-table').each(
function () {
$ret.push( $(this).attr('row_index') );
}
);
return $ret;
}
ShopCartManager.prototype.getNewRows = function ($data) {
var $ret = [];
if ( $.isArray($data.items) ) {
return $data.items;
}
for (var $row_index in $data.items) {
$ret.push( $row_index );
}
return $ret;
}
ShopCartManager.prototype.formatPrice = function ($price, $decimal_tag) {
if ( $decimal_tag === undefined ) {
$decimal_tag = 'span';
}
var $price_parts = $price.toFixed(2).toString().split('.');
return this.currencyMask.replace('%s', $price_parts[0] + '.<' + $decimal_tag + '>' + $price_parts[1] + '</' + $decimal_tag + '>');
}
ShopCartManager.prototype.getQtyErrorOptions = function ($error_code) {
var $ret = false;
switch ($error_code) {
case this.constants['OrderCheckoutError::FIELD_UPDATE_SUCCESS']:
$ret = this.getTooltipOptions('FIELD_UPDATE_SUCCESS', 'ui-tooltip-green');
break;
case this.constants['OrderCheckoutError::FIELD_UPDATE_ERROR']:
$ret = this.getTooltipOptions('FIELD_UPDATE_ERROR', 'ui-tooltip-red');
break;
case this.constants['OrderCheckoutError::QTY_UNAVAILABLE']:
$ret = this.getTooltipOptions('QTY_UNAVAILABLE', 'ui-tooltip-red');
break;
case this.constants['OrderCheckoutError::QTY_OUT_OF_STOCK']:
$ret = this.getTooltipOptions('QTY_OUT_OF_STOCK', 'ui-tooltip-red');
break;
case this.constants['OrderCheckoutError::QTY_CHANGED_TO_MINIMAL']:
$ret = this.getTooltipOptions('QTY_CHANGED_TO_MINIMAL', 'ui-tooltip-green');
break;
}
return $ret;
}
ShopCartManager.prototype.getCouponErrorOptions = function ($error_code) {
var $ret = false;
switch ($error_code) {
case this.constants['OrderCheckoutError::COUPON_APPLIED']: // for label
$ret = this.getTooltipOptions('COUPON_APPLIED', 'ui-tooltip-green');
break;
// all next error for input
case this.constants['OrderCheckoutError::COUPON_REMOVED']:
$ret = this.getTooltipOptions('COUPON_REMOVED', 'ui-tooltip-green');
break;
case this.constants['OrderCheckoutError::COUPON_REMOVED_AUTOMATICALLY']:
$ret = this.getTooltipOptions('COUPON_REMOVED_AUTOMATICALLY', 'ui-tooltip-green');
break;
case this.constants['OrderCheckoutError::COUPON_CODE_INVALID']:
$ret = this.getTooltipOptions('COUPON_CODE_INVALID', 'ui-tooltip-red');
break;
case this.constants['OrderCheckoutError::COUPON_CODE_EXPIRED']:
$ret = this.getTooltipOptions('COUPON_CODE_EXPIRED', 'ui-tooltip-red');
break;
}
return $ret;
}
ShopCartManager.prototype.getGiftCertificateErrorOptions = function ($error_code) {
var $ret = false;
switch ($error_code) {
case this.constants['OrderCheckoutError::GC_APPLIED']: // for label
$ret = this.getTooltipOptions('GC_APPLIED', 'ui-tooltip-green');
break;
// all next error for input
case this.constants['OrderCheckoutError::GC_REMOVED']:
$ret = this.getTooltipOptions('GC_REMOVED', 'ui-tooltip-green');
break;
case this.constants['OrderCheckoutError::GC_REMOVED_AUTOMATICALLY']:
$ret = this.getTooltipOptions('GC_REMOVED_AUTOMATICALLY', 'ui-tooltip-green');
break;
case this.constants['OrderCheckoutError::GC_CODE_INVALID']:
$ret = this.getTooltipOptions('GC_CODE_INVALID', 'ui-tooltip-red');
break;
case this.constants['OrderCheckoutError::GC_CODE_EXPIRED']:
$ret = this.getTooltipOptions('GC_CODE_EXPIRED', 'ui-tooltip-red');
break;
}
return $ret;
}
ShopCartManager.prototype.getDiscountErrorOptions = function ($error_code) {
var $ret = false;
switch ($error_code) {
case this.constants['OrderCheckoutError::DISCOUNT_APPLIED']:
$ret = this.getTooltipOptions('DISCOUNT_APPLIED', 'ui-tooltip-green');
break;
case this.constants['OrderCheckoutError::DISCOUNT_REMOVED']:
$ret = this.getTooltipOptions('DISCOUNT_REMOVED', 'ui-tooltip-green');
break;
}
return $ret;
}
ShopCartManager.prototype.createTooltip = function ($input, $tooltip_options) {
var $me = this,
$tooltip = $input.next('.formStatus'),
$is_error = $tooltip_options.classes == 'ui-tooltip-red',
$timer = $input.data('timer');
clearTimeout($timer);
if ( $tooltip.length == 1 ) {
$tooltip.hide().remove();
}
$tooltip = $('<div class="formStatus ' + ($is_error ? 'formError' : 'formSuccess') + '" style="display: none;">\
<div class="formContent">' + $tooltip_options.text + '</div>\
<div class="formArrow"></div>\
</div>');
$input
.after($tooltip)
.removeClass('statusSuccess statusError')
.addClass($is_error ? 'statusError' : 'statusSuccess');
$tooltip.fadeIn(
'slow',
function () {
$timer = setTimeout( function() { $me.removeTooltip($input); }, 2000);
$input.data('timer', $timer);
}
);
$input.focus( function() { $me.removeTooltip($input); } );
}
ShopCartManager.prototype.removeTooltip = function ($input) {
var $tooltip = $input.next('.formStatus');
$input.removeClass('statusError').removeClass('statusSuccess');
$tooltip.fadeOut('slow', function() { $tooltip.remove(); });
}
ShopCartManager.prototype.getTooltipOptions = function ($text, $css_classes) {
return {
text: $text,
classes: $css_classes
};
}
Index: branches/1.0.x/elements/ajax/product_options.tpl
===================================================================
--- branches/1.0.x/elements/ajax/product_options.tpl (nonexistent)
+++ branches/1.0.x/elements/ajax/product_options.tpl (revision 15019)
@@ -0,0 +1,166 @@
+<inp2:m_Include template="elements/options.elm" strip_nl="2"/>
+
+<form method="post" id="product-options-form" action="<inp2:m_Link template='elements/ajax/product_options' pass='all,p'/>">
+ <input type="hidden" name="events[ord]" id="events[ord]" value="OnAddToCart"/>
+ <input type="hidden" name="p_id" value="<inp2:p_Field name='ProductId'/>"/>
+ <input type="hidden" name="product_details_template" value="<inp2:m_Get var='t'/>"/>
+
+ <inp2:m_if check="p_OptionsUpdateMode">
+ <input type="hidden" name="shop_cart_template" value="cart"/>
+ <inp2:m_else/>
+ <input type="hidden" name="shop_cart_template" value="elements/ajax/cart_bubble"/>
+ </inp2:m_if>
+
+ <inp2:m_if check="p_FieldEquals" field="OptionsSelectionMode" value="1"> <!-- Listable options (combinations) -->
+ <div class="options-har">
+ <inp2:m_if check="p_OptionsHaveError">
+ <div class="red" style="padding: 0px;">
+ <inp2:p_OptionsError required="lu_comm_OptionsRequired" not_available="lu_comm_OptionsNotAvailable"/>
+ <br/><br/>
+ </div>
+ </inp2:m_if>
+
+ <table>
+ <tr class="cart-header">
+ <th>Options Combination</th>
+ <th>Price</th>
+ <th>&nbsp;</th>
+ </tr>
+
+ <inp2:poc_PrintList render_as="combination_element" per_page="-1"/>
+ </table>
+ </div>
+
+ <div class="price-block">
+ <p><s class="under"><inp2:p_Field name="MSRP" currency="selected" decimal_tag="span"/></s></p>
+ <p class="redprice"><em class="price"><inp2:p_Field name="Price" currency="selected" decimal_tag="span"/></em></p>
+ </div>
+
+ <div class="order-block">
+ <p class="qty form"><strong>Qty.</strong>&nbsp;&nbsp;<input type="text" id="product-qty" value="1" class="field" /></p>
+ <p class="avail">Availability: <em><inp2:m_if check="p_Available">In Stock<inp2:m_else/>Not In Stock</inp2:m_if></em></p>
+ </div>
+ <inp2:m_else/> <!-- Selectable options -->
+ <div class="options-har">
+ <inp2:m_if check="p_OptionsHaveError">
+ <div class="red" style="padding: 0px;">
+ <inp2:p_OptionsError required="lu_comm_OptionsRequired" not_available="lu_comm_OptionsNotAvailable"/>
+ <br/><br/>
+ </div>
+ </inp2:m_if>
+
+ <table>
+ <inp2:po_PrintList render_as="option_element" per_page="-1"/>
+ </table>
+ </div>
+
+ <div class="price-block">
+ <p><s class="under"><inp2:p_Field name="MSRP" currency="selected" decimal_tag="span"/></s></p>
+ <p class="redprice"><em class="price"><inp2:p_Field name="Price" currency="selected" decimal_tag="span"/></em></p>
+ </div>
+
+ <div class="order-block">
+ <p class="qty form"><strong>Qty.</strong>&nbsp;&nbsp;<input type="text" name="qty" id="product-qty" value="<inp2:m_if check='m_Get' name='qty'><inp2:m_Get name='qty'/><inp2:m_else/>1</inp2:m_if>" class="field" /></p>
+ <p class="but">
+ <inp2:m_if check="p_OptionsUpdateMode">
+ <a href="#" id="add-to-cart-btn" onclick="UpdateOptions(); return false;" class="addtocart" rel="nofollow"><span><i>Update Options</i></span></a>
+ <inp2:m_else/>
+ <inp2:m_if check="m_Get" name="already_added">
+ <a href="#" id="add-to-cart-btn" onclick="AddToCart(); return false;" class="addedtocart" rel="nofollow"><span><i>Added to Cart</i></span></a>
+ <inp2:m_else/>
+ <a href="#" id="add-to-cart-btn" onclick="AddToCart(); return false;" class="addtocart" rel="nofollow"><span><i>Add to Cart</i></span></a>
+ </inp2:m_if>
+ </inp2:m_if>
+ </p>
+ <p class="avail">Availability: <em><inp2:m_if check="p_Available">In Stock<inp2:m_else/>Not In Stock</inp2:m_if></em></p>
+ </div>
+ </inp2:m_if>
+</form>
+
+<script type="text/javascript">
+ <inp2:m_if check="p_FieldEquals" field="OptionsSelectionMode" value="1">
+ function BuyCombination(comb_id) {
+ document.getElementById('qty[<inp2:p_Field name="ProductId"/>][' + comb_id + ']').value = get_cart_qty('#product-qty');
+ $('#product-options-form').submit();
+ }
+ <inp2:m_else/>
+ function AddToCart() {
+ $('#product-options-form').submit();
+ }
+
+ function UpdateOptions() {
+ document.getElementById('events[ord]').value = 'OnUpdateItemOptions';
+ $('#product-options-form').submit();
+ }
+ </inp2:m_if>
+
+ $(document).ready(
+ function () {
+ $('#product-options-form').submit(
+ function ($e) {
+ var $form = $(this),
+ $cart_btn = $('#add-to-cart-btn');
+
+ if ( $cart_btn.hasClass('addedtocart') ) {
+ // disabled button
+ return false;
+ }
+
+ $.post(
+ $form.attr('action'),
+ $form.serialize(),
+ function ($response) {
+ var $redirect_url = TB.parseRedirect($response);
+
+ if ( $redirect_url !== false ) {
+ if ( $redirect_url.indexOf('bubble') != -1 ) {
+ var $timer_id = $('.basketStatus').data('hide_timer'),
+ $qty = get_cart_qty('#product-qty');
+
+ // reset options form
+ $form.load($form.attr('action') + '&already_added=1');
+ clearTimeout($timer_id);
+
+ $.get(
+ $redirect_url,
+ function ($bubble_content) {
+ display_cart_bubble($bubble_content, $qty);
+ }
+ );
+ }
+ else {
+ redirect($redirect_url);
+ }
+ }
+ else {
+ // got error, show same form
+ $('#product-options-form').replaceWith($response);
+ }
+ }
+ )
+
+ return false;
+ }
+ );
+ }
+ );
+</script>
+
+<!--<div class="sel-options">
+ <label><strong>Select Size:</strong>
+ <select name="select" class="field-alt">
+ <option value="" selected="selected">22"</option>
+ <option value="">23"</option>
+ </select>
+ </label>
+</div>
+<div class="sel-options">
+ <label><strong>Select Color:</strong>
+ <select name="select" class="field-alt">
+ <option value="" selected="selected">Gray Metallic</option>
+ <option value="">White Metallic</option>
+ <option value="">Black Metallic</option>
+ </select>
+ </label>
+</div>
+<div class="clear"></div>-->
\ No newline at end of file
Index: branches/1.0.x/elements/ajax/order_details.tpl
===================================================================
--- branches/1.0.x/elements/ajax/order_details.tpl (revision 15018)
+++ branches/1.0.x/elements/ajax/order_details.tpl (revision 15019)
@@ -1,38 +1,51 @@
<inp2:m_Include template="elements/content_boxes.elm" strip_nl="2"/>
+<inp2:m_Include template="elements/options.elm" strip_nl="2"/>
<inp2:m_DefineElement name="orderitem_elem">
<tr>
- <td class="item-img">
+ <td class="item-img"<inp2:m_if check="HasOptions"> rowspan="2"</inp2:m_if>>
<inp2:p_Image render_as="image_element" Primary="1" MaxWidth="58" DefaultWidth="58" DefaultImage="img/no_picture.gif"/>
</td>
<td class="item-title">
<inp2:Field name="ProductName"/><inp2:m_if check="ord_BackorderFlag"> <span><inp2:m_phrase label="lu_cart_BackorderFlag" /></span></inp2:m_if>
<inp2:m_if check="HasDiscount">
<br />
<inp2:m_Phrase label="lu_comm_RegularPrice" />: <inp2:Field name="FlatPrice" currency="selected"/><br />
<inp2:m_Phrase label="lu_comm_Discount" />: <span><inp2:Field name="ItemDiscount" currency="selected" negative="1"/></span>
</inp2:m_if>
</td>
<td><inp2:Field name="Quantity"/></td>
<td><inp2:Field name="Price" currency="selected"/></td>
<td><inp2:Field name="ExtendedPrice" currency="selected"/></td>
</tr>
+
+ <inp2:m_if check="HasOptions">
+ <tr>
+ <td class="options-td" colspan="5">
+ <inp2:m_if check="DisplayOptionsPricing">
+ <inp2:PrintOptions render_as="ro_option_element" currency="selected"/>
+ <inp2:m_else/>
+ <inp2:PrintOptions render_as="ro_option_element_no_price" currency="selected"/>
+ </inp2:m_if>
+ </td>
+ </tr>
+ </inp2:m_if>
</inp2:m_DefineElement>
<div class="cart-detail receipt" style="width: 90%;">
<table class="items">
<thead>
<tr>
<th colspan="2" style="text-align: left;">Items in your order (<inp2:ord_ItemsInCart/>)</th>
<th>Qty.</th>
<th>Price</th>
<th>Total</th>
</tr>
</thead>
<tbody>
<inp2:ord_ListOrderItems render_as="orderitem_elem"/>
</tbody>
</table>
</div>
\ No newline at end of file
Index: branches/1.0.x/elements/side_boxes/recently_viewed.elm.tpl
===================================================================
--- branches/1.0.x/elements/side_boxes/recently_viewed.elm.tpl (revision 15018)
+++ branches/1.0.x/elements/side_boxes/recently_viewed.elm.tpl (revision 15019)
@@ -1,23 +1,31 @@
<inp2:m_Cache key="prefix:p;currency;guest_only">
<inp2:p_InitList list_name="recent_products" types="recent" parent_cat_id="any" per_page="short_list"/>
<div class="block no-border-bottom">
<h2><em>Our Favorites</em><span class="pick"></span></h2>
<inp2:m_DefineElement name="pick_product_element">
<dt><a href="<inp2:ProductLink template='__default__'/>"><inp2:Field field="Name" html_escape="1"/></a></dt>
<dd>
<p class="img"><a href="<inp2:ProductLink template='__default__'/>"><inp2:Image render_as="image_element" Primary="1" Thumbnail="1" DefaultImage="img/no_picture.gif" MaxWidth="136" MaxHeight="136"/></a></p>
<p class="price"><inp2:Field name="Price" currency="selected" decimal_tag="span"/></p>
- <p><a href="<inp2:AddToCartLink template='elements/ajax/cart_bubble' product_template='__default__'/>" class="addtocart" rel="nofollow"><span>Add to Cart</span></a></p>
+ <p>
+ <a href="<inp2:AddToCartLink template='elements/ajax/cart_bubble' product_template='__default__'/>" class="addtocart" rel="nofollow">
+ <inp2:m_if check="Field" name="HasRequiredOptions" db="db">
+ <span>Click to See</span>
+ <inp2:m_else/>
+ <span>Add to Cart</span>
+ </inp2:m_if>
+ </a>
+ </p>
</dd>
</inp2:m_DefineElement>
<div class="good-item border-radius-bottom">
<dl>
<inp2:p_ListProducts list_name="recent_products" render_as="pick_product_element" no_table="1"/>
</dl>
</div>
</div>
</inp2:m_Cache>
\ No newline at end of file
Index: branches/1.0.x/elements/product_elements.elm.tpl
===================================================================
--- branches/1.0.x/elements/product_elements.elm.tpl (revision 15018)
+++ branches/1.0.x/elements/product_elements.elm.tpl (revision 15019)
@@ -1,60 +1,76 @@
<inp2:m_DefineElement name="product_list_element">
<li>
<div class="item">
<inp2:m_if check="Field" name="IsNew">
<div class="ribbon new"></div>
<inp2:m_elseif check="Field" name="IsPop" />
<div class="ribbon top"></div>
<inp2:m_elseif check="Field" name="Featured" db="1" />
<div class="ribbon sale"></div>
</inp2:m_if>
<div class="img">
<a href="<inp2:ProductLink template='__default__'/>"><inp2:Image render_as="image_element" Primary="1" Thumbnail="1" DefaultImage="img/no_picture.gif" MaxWidth="69" MaxHeight="69"/></a>
</div>
<div class="descr">
<h3><a href="<inp2:ProductLink template='__default__'/>"><inp2:Field field="Name" html_escape="1"/></a></h3>
<p><inp2:Field field="Description" html_escape="1" cut_first="200"/></p>
<div class="optional">
<span class="stars">
<inp2:VotesIndicator small_style="small-star"/>
</span>
<span class="reviews">
<a href="<inp2:ProductLink template='__default__'/>">Reviews</a> (<a href="<inp2:ProductLink template='__default__'/>"><inp2:Field name="CachedReviewsQty"/></a>)&nbsp;&nbsp;&nbsp;
</span>
<span class="comp">
<label><input type="checkbox" class="compare-checkbox" value="<inp2:Field name='ProductId'/>"<inp2:m_if check="InCompare"> checked</inp2:m_if>/><em>Compare</em></label>
</span>
</div>
</div>
<div class="price-block">
<p><s class="under"><inp2:Field name="MSRP" currency="selected" decimal_tag="span"/></s></p>
<p class="redprice"><em class="price"><inp2:Field name="Price" currency="selected" decimal_tag="span"/></em></p>
- <p><a href="<inp2:AddToCartLink template='elements/ajax/cart_bubble' product_template='__default__'/>" class="addtocart" rel="nofollow"><span>Add to Cart</span></a></p>
+ <p>
+ <a href="<inp2:AddToCartLink template='elements/ajax/cart_bubble' product_template='__default__'/>" class="addtocart" rel="nofollow">
+ <inp2:m_if check="Field" name="HasRequiredOptions" db="db">
+ <span>Click to See</span>
+ <inp2:m_else/>
+ <span>Add to Cart</span>
+ </inp2:m_if>
+ </a>
+ </p>
</div>
</div>
</li>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="sidebox_product_element">
<dl class="<inp2:m_if check='m_Param' name='is_last'>last</inp2:m_if>">
<dt><a href="<inp2:ProductLink template='__default__'/>"><inp2:Field field="Name" html_escape="1" cut_first="45"/></a></dt>
<dd>
<p class="img"><a href="<inp2:ProductLink template='__default__'/>"><inp2:Image render_as="image_element" Primary="1" Thumbnail="1" DefaultImage="img/no_picture.gif" MaxWidth="136" MaxHeight="136"/></a></p>
<p class="price"><inp2:Field name="Price" currency="selected" decimal_tag="span"/></p>
- <p><a href="<inp2:AddToCartLink template='elements/ajax/cart_bubble' product_template='__default__'/>" class="addtocart" rel="nofollow"><span>Add to Cart</span></a></p>
+ <p>
+ <a href="<inp2:AddToCartLink template='elements/ajax/cart_bubble' product_template='__default__'/>" class="addtocart" rel="nofollow">
+ <inp2:m_if check="Field" name="HasRequiredOptions" db="db">
+ <span>Click to See</span>
+ <inp2:m_else/>
+ <span>Add to Cart</span>
+ </inp2:m_if>
+ </a>
+ </p>
</dd>
</dl>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="compare_product_element">
<dl>
<dt><a href="<inp2:ProductLink template='__default__'/>"><inp2:Field name="Name"/></a></dt>
<dd>
<p class="img">
<a href="<inp2:ProductLink template='__default__'/>"><inp2:Image render_as="image_element" Primary="1" Thumbnail="1" DefaultImage="img/no_picture.gif" MaxWidth="136" MaxHeight="136"/></a>
</p>
<p class="button-delete" product_id="<inp2:Field name='ProductId'/>"><a href="#"><img src="<inp2:m_TemplatesBase/>img/icon-delete.png" width="13" height="13" alt="" /></a></p>
</dd>
</dl>
</inp2:m_DefineElement>
\ No newline at end of file
Index: branches/1.0.x/elements/options.elm.tpl
===================================================================
--- branches/1.0.x/elements/options.elm.tpl (nonexistent)
+++ branches/1.0.x/elements/options.elm.tpl (revision 15019)
@@ -0,0 +1,113 @@
+<!--## editable blocks ##-->
+<inp2:m_DefineElement name="combination_option_element">
+ <strong><inp2:m_Param name="option_name" />: </strong>
+ <inp2:m_Param name="option_value" /><inp2:m_if check="m_ParamEquals" param="is_last" value="1"><inp2:m_else/>, </inp2:m_if>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="combination_element">
+ <tr class="cart-item-small">
+ <td>
+ <input type="hidden" id="qty[<inp2:p_Field name='ProductId'/>][<inp2:Field name='CombinationId'/>]" name="qty[<inp2:p_Field name='ProductId'/>][<inp2:Field name='CombinationId'/>]" value="0"/>
+ <inp2:ShowCombination render_as="combination_option_element"/>
+ </td>
+ <td><inp2:Field name="FinalPrice" currency="selected"/>&nbsp;&nbsp;</td>
+ <td>
+ <a href="#" onclick="BuyCombination(<inp2:Field name='CombinationId'/>); return false;">Add to Cart</a>
+ </td>
+ </tr>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="option_select_element">
+ <option value="<inp2:m_param name='id'/>" <inp2:m_param name="selected"/>>
+ <inp2:m_param name="value"/><inp2:m_ifnot check="m_Param" name="price" equals_to="">: (<inp2:m_param name="sign"/><inp2:m_param name="price"/> <inp2:m_param name="price_type"/>)</inp2:m_ifnot>
+ </option>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="option_cb_element">
+ <input
+ type="checkbox"
+ <inp2:m_param name="selected"/>
+ name="options[<inp2:p_Field name='ProductId'/>][<inp2:Field name='ProductOptionId'/>][]"
+ id="options[<inp2:p_Field name='ProductId'/>][<inp2:Field name='ProductOptionId'/>]_<inp2:m_param name='id'/>"
+ value="<inp2:m_param name='id'/>"
+ />
+
+ <label for="options[<inp2:p_Field name='ProductId'/>][<inp2:Field name='ProductOptionId'/>]_<inp2:m_param name='id'/>">
+ <inp2:m_param name="value"/><inp2:m_ifnot check="m_Param" name="price" equals_to="">: (<inp2:m_param name="sign"/><inp2:m_param name="price"/> <inp2:m_param name="price_type"/>)</inp2:m_ifnot>&nbsp;&nbsp;
+ </label>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="option_radio_element">
+ <input
+ type="radio"
+ <inp2:m_param name="selected"/>
+ name="options[<inp2:p_Field name='ProductId'/>][<inp2:Field name='ProductOptionId'/>]"
+ id="options[<inp2:p_Field name='ProductId'/>][<inp2:Field name='ProductOptionId'/>]_<inp2:m_param name='id'/>"
+ value="<inp2:m_param name='id'/>"
+ />
+
+ <label for="options[<inp2:p_Field name='ProductId'/>][<inp2:Field name='ProductOptionId'/>]_<inp2:m_param name='id'/>">
+ <inp2:m_param name="value"/><inp2:m_ifnot check="m_Param" name="price" equals_to="">: (<inp2:m_param name="sign"/><inp2:m_param name="price"/> <inp2:m_param name="price_type"/>)</inp2:m_ifnot>&nbsp;&nbsp;
+ </label>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="option_element">
+ <tr>
+ <td style="padding-right: 10px">
+ <inp2:Field name="Name"/><inp2:m_if check="FieldEquals" field="Required" value="1"><span class="star">*</span></inp2:m_if> :
+ </td>
+ <td>
+ <inp2:m_if check="FieldEquals" field="OptionType" value="1"> <!-- drop-down -->
+ <select name="options[<inp2:p_Field name='ProductId'/>][<inp2:Field name='ProductOptionId'/>]">
+ <option value=""></option>
+ <inp2:ShowOptions render_as="option_select_element" currency="selected"/>
+ </select>
+ </inp2:m_if>
+
+ <inp2:m_if check="FieldEquals" field="OptionType" value="5"> <!-- editbox -->
+ <input type="text" name="options[<inp2:p_Field name='ProductId'/>][<inp2:Field name='ProductOptionId'/>]" value="<inp2:OptionData/>"/>
+ </inp2:m_if>
+
+ <inp2:m_if check="FieldEquals" field="OptionType" value="4"> <!-- textarea -->
+ <textarea cols="35" rows="5" class="input-textarea" name="options[<inp2:p_Field name='ProductId'/>][<inp2:Field name='ProductOptionId'/>]"><inp2:OptionData/></textarea>
+ </inp2:m_if>
+
+ <inp2:m_if check="FieldEquals" field="OptionType" value="6"> <!-- checkboxeS -->
+ <inp2:ShowOptions render_as="option_cb_element" currency="selected"/>
+ </inp2:m_if>
+
+ <inp2:m_if check="FieldEquals" field="OptionType" value="3"> <!-- radio buttons -->
+ <inp2:ShowOptions render_as="option_radio_element" currency="selected"/>
+ </inp2:m_if>
+ </td>
+ </tr>
+</inp2:m_DefineElement>
+
+<!--## read only blocks ##-->
+<inp2:m_DefineElement name="ro_option_element">
+ <inp2:m_if check="m_Param" name="type" equals_to="6"> <!-- checkboxes - multiple -->
+ <strong><inp2:m_param name="option"/>:</strong><inp2:PrintOptionValues render_as="ro_option_value_element" currency="selected"/>
+ <inp2:m_else/>
+ <strong><inp2:m_param name="option"/>:</strong> <inp2:m_param name="value"/>
+ <inp2:m_ifnot check="m_Param" name="price" equals_to=""> (<inp2:m_param name="sign"/><inp2:m_param name="price"/> <inp2:m_param name="price_type"/>)</inp2:m_ifnot>
+ </inp2:m_if>
+ <br/>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="ro_option_value_element">
+ <inp2:m_param name="value"/> <inp2:m_ifnot check="m_Param" name="price" equals_to=""> (<inp2:m_param name="sign"/><inp2:m_param name="price"/> <inp2:m_param name="price_type"/>)</inp2:m_ifnot>
+ <inp2:m_ifnot check="m_Param" name="is_last">, </inp2:m_ifnot>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="ro_option_element_no_price">
+ <inp2:m_if check="m_Param" name="type" equals_to="6"> <!-- checkboxes - multiple -->
+ <strong><inp2:m_param name="option"/>:</strong><inp2:PrintOptionValues render_as="ro_option_value_element_no_price"/>
+ <inp2:m_else/>
+ <strong><inp2:m_param name="option"/>:</strong> <inp2:m_param name="value"/>
+ </inp2:m_if><br/>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="ro_option_value_element_no_price">
+ <inp2:m_param name="value"/>
+ <inp2:m_ifnot check="m_Param" name="is_last">, </inp2:m_ifnot>
+</inp2:m_DefineElement>
\ No newline at end of file
Index: branches/1.0.x/elements/content_boxes/special_deals.elm.tpl
===================================================================
--- branches/1.0.x/elements/content_boxes/special_deals.elm.tpl (revision 15018)
+++ branches/1.0.x/elements/content_boxes/special_deals.elm.tpl (revision 15019)
@@ -1,30 +1,38 @@
<inp2:m_Cache key="prefix:p;currency;guest_only">
<inp2:p_InitList list_name="featured_products" types="featured" parent_cat_id="0" recursive="1" per_page="10" sort_by="random"/>
<inp2:m_DefineElement name="featured_product_element">
<div class="good-item good-item-float">
<dl>
<dt><a href="<inp2:ProductLink template='__default__'/>"><inp2:Field field="Name" html_escape="1" cut_first="45"/></a></dt>
<dd>
<p class="img"><a href="<inp2:ProductLink template='__default__'/>"><inp2:Image render_as="image_element" Primary="1" Thumbnail="1" DefaultImage="img/no_picture.gif" MaxWidth="136" MaxHeight="136"/></a></p>
<p class="price-deal"><s class="under"><inp2:Field name="MSRP" currency="selected" decimal_tag="span"/></s><em class="price"><inp2:Field name="Price" currency="selected" decimal_tag="span"/></em></p>
- <p><a href="<inp2:AddToCartLink template='elements/ajax/cart_bubble' product_template='__default__'/>" class="addtocart" rel="nofollow"><span>Add to Cart</span></a></p>
+ <p>
+ <a href="<inp2:AddToCartLink template='elements/ajax/cart_bubble' product_template='__default__'/>" class="addtocart" rel="nofollow">
+ <inp2:m_if check="Field" name="HasRequiredOptions" db="db">
+ <span>Click to See</span>
+ <inp2:m_else/>
+ <span>Add to Cart</span>
+ </inp2:m_if>
+ </a>
+ </p>
</dd>
</dl>
</div>
</inp2:m_DefineElement>
<div class="block block-margin no-border-bottom">
<h2><em>Special Deals</em><span class="sale"></span></h2>
<div id="scrollable">
<div class="items">
<inp2:p_ListProducts list_name="featured_products" render_as="featured_product_element" no_table="1"/>
<div class="clear"></div>
</div>
</div>
</div>
</inp2:m_Cache>
\ No newline at end of file
Index: branches/1.0.x/elements/content_boxes/new_products.elm.tpl
===================================================================
--- branches/1.0.x/elements/content_boxes/new_products.elm.tpl (revision 15018)
+++ branches/1.0.x/elements/content_boxes/new_products.elm.tpl (revision 15019)
@@ -1,26 +1,34 @@
<inp2:m_Cache key="prefix:p;currency;guest_only">
<inp2:p_InitList list_name="new_products" types="new" parent_cat_id="0" recursive="1" per_page="4" sort_by="random"/>
<inp2:m_DefineElement name="product_new_element">
<div class="good-item good-item-narrow <inp2:m_if check='m_Param' name='is_last'>good-item-narrow-last </inp2:m_if>good-item-float border-radius">
<dl>
<dt><a href="<inp2:ProductLink template='__default__'/>"><inp2:Field field="Name" html_escape="1" cut_first="32"/></a></dt>
<dd>
<p class="img"><a href="<inp2:ProductLink template='__default__'/>"><inp2:Image render_as="image_element" Primary="1" Thumbnail="1" DefaultImage="img/no_picture.gif" MaxWidth="136" MaxHeight="136"/></a></p>
<p class="price"><inp2:Field name="Price" currency="selected" decimal_tag="span"/></p>
- <p><a href="<inp2:AddToCartLink template='elements/ajax/cart_bubble' product_template='__default__'/>" class="addtocart" rel="nofollow"><span>Add to Cart</span></a></p>
+ <p>
+ <a href="<inp2:AddToCartLink template='elements/ajax/cart_bubble' product_template='__default__'/>" class="addtocart" rel="nofollow">
+ <inp2:m_if check="Field" name="HasRequiredOptions" db="db">
+ <span>Click to See</span>
+ <inp2:m_else/>
+ <span>Add to Cart</span>
+ </inp2:m_if>
+ </a>
+ </p>
</dd>
</dl>
</div>
</inp2:m_DefineElement>
<div class="block no-border-bottom">
<h2><em>New Arrivals</em><span class="new"></span></h2>
<inp2:p_ListProducts list_name="new_products" render_as="product_new_element" no_table="1"/>
<div class="clear"></div>
</div>
</inp2:m_Cache>
\ No newline at end of file

Event Timeline