Page MenuHomeIn-Portal Phabricator

modern-store
No OneTemporary

File Metadata

Created
Sun, Apr 20, 4:53 AM

modern-store

Index: branches/1.0.x/products/compare.tpl
===================================================================
--- branches/1.0.x/products/compare.tpl (revision 14909)
+++ branches/1.0.x/products/compare.tpl (revision 14910)
@@ -1,159 +1,162 @@
<!--##
<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"/>
+
<div class="block no-border-bottom">
- <h2><em>Comparing Products (4)</em><span></span></h2>
+ <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">
- <div class="good-item">
- <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="#">Nikon D5000 Digital Camera</a></dt>
- <dd>
- <p class="img"><a href="#"><img src="<inp2:m_TemplatesBase/>img/samples/good1.jpg" width="136" height="136" alt="" /></a></p>
- <p class="price">$759.<span>95</span></p>
- <p><a href="#" class="addtocart"><span>Add to Cart</span></a></p>
- </dd>
- </dl>
- <div class="rating">
- <p><img src="<inp2:m_TemplatesBase/>img/star-small.jpg" width="18" height="18" alt="" /><img src="<inp2:m_TemplatesBase/>img/star-small.jpg" width="18" height="18" alt="" /><img src="<inp2:m_TemplatesBase/>img/star-small.jpg" width="18" height="18" alt="" /><img src="<inp2:m_TemplatesBase/>img/star-small.jpg" width="18" height="18" alt="" /><img src="<inp2:m_TemplatesBase/>img/star-small.jpg" width="18" height="18" alt="" /></p>
- <p><a href="">Reviews</a> (<a href="">12</a>)</p>
- </div>
- <dl class="har">
- <dt>Model:</dt>
- <dd>XT2324</dd>
- <dt>Manufacturer:</dt>
- <dd>Apple</dd>
- <dt>SKU:</dt>
- <dd>23423424</dd>
- <dt>Size:</dt>
- <dd>22''</dd>
- </dl>
- </div>
- <div class="good-item">
- <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="#">Nikon D5000 Digital Camera</a></dt>
- <dd>
- <p class="img"><a href="#"><img src="<inp2:m_TemplatesBase/>img/samples/good1.jpg" width="136" height="136" alt="" /></a></p>
- <p class="price">$759.<span>95</span></p>
- <p><a href="#" class="addtocart"><span>Add to Cart</span></a></p>
- </dd>
- </dl>
- <div class="rating">
- <p><img src="<inp2:m_TemplatesBase/>img/star-small.jpg" width="18" height="18" alt="" /><img src="<inp2:m_TemplatesBase/>img/star-small.jpg" width="18" height="18" alt="" /><img src="<inp2:m_TemplatesBase/>img/star-small.jpg" width="18" height="18" alt="" /><img src="<inp2:m_TemplatesBase/>img/star-small.jpg" width="18" height="18" alt="" /><img src="<inp2:m_TemplatesBase/>img/star-small.jpg" width="18" height="18" alt="" /></p>
- <p><a href="">Reviews</a> (<a href="">12</a>)</p>
- </div>
- <dl class="har">
- <dt>Model:</dt>
- <dd>XT2324</dd>
- <dt>Manufacturer:</dt>
- <dd>Apple</dd>
- <dt>SKU:</dt>
- <dd>23423424</dd>
- <dt>Size:</dt>
- <dd>22''</dd>
- </dl>
- </div>
- <div class="good-item">
- <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="#">Nikon D5000 Digital Camera</a></dt>
- <dd>
- <p class="img"><a href="#"><img src="<inp2:m_TemplatesBase/>img/samples/good1.jpg" width="136" height="136" alt="" /></a></p>
- <p class="price">$759.<span>95</span></p>
- <p><a href="#" class="addtocart"><span>Add to Cart</span></a></p>
- </dd>
- </dl>
- <div class="rating">
- <p><img src="<inp2:m_TemplatesBase/>img/star-small.jpg" width="18" height="18" alt="" /><img src="<inp2:m_TemplatesBase/>img/star-small.jpg" width="18" height="18" alt="" /><img src="<inp2:m_TemplatesBase/>img/star-small.jpg" width="18" height="18" alt="" /><img src="<inp2:m_TemplatesBase/>img/star-small.jpg" width="18" height="18" alt="" /><img src="<inp2:m_TemplatesBase/>img/star-small.jpg" width="18" height="18" alt="" /></p>
- <p><a href="">Reviews</a> (<a href="">12</a>)</p>
+ <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>
+ </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>
- <dl class="har">
- <dt>Model:</dt>
- <dd>XT2324</dd>
- <dt>Manufacturer:</dt>
- <dd>Apple</dd>
- <dt>SKU:</dt>
- <dd>23423424</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 class="good-item last-child">
- <p class="buttons-block"><a href="#" 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>
+ <p class="buttons-block"><a href="<inp2:m_Link template='index'/>" 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;">
<h3><a href="#">Description</a></h3>
<div>
- <div class="good-item-cell">
- <div class="description">
- <p>Vestibulum eu ipsum est. Morbi risus magna, aliquam eu consequat in, ultricies quis lorem. Maecenas rutrum pulvinar lectus, vel aliquam lorem porttitor nec. Phasellus non orci sem. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec massa massa. Proin ac leo mauris.</p><p>Mauris ut felis Phasellus non orci sem. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec massa massa. Proin ac leo mauris.</p>
- </div>
- </div>
- <div class="good-item-cell">
- <div class="description">
- <p>Vestibulum eu ipsum est. Morbi risus magna, aliquam eu consequat in, ultricies quis lorem. Maecenas rutrum pulvinar lectus, vel aliquam lorem porttitor nec. Phasellus non orci sem. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec massa massa. Proin ac leo mauris.</p><p>Mauris ut felis Phasellus non orci sem. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec massa massa. Proin ac leo mauris.</p>
- </div>
- </div>
- <div class="good-item-cell">
- <div class="description">
- <p>Vestibulum eu ipsum est. Morbi risus magna, aliquam eu consequat in, ultricies quis lorem. Maecenas rutrum pulvinar lectus, vel aliquam lorem porttitor nec. Phasellus non orci sem. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec massa massa. Proin ac leo mauris.</p><p>Mauris ut felis Phasellus non orci sem. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec massa massa. Proin ac leo mauris.</p>
+ <inp2:m_DefineElement name="product_compare_description">
+ <div class="good-item-cell">
+ <div class="description">
+ <p><inp2:Field name="Description"/></p>
+ </div>
</div>
- </div>
+ </inp2:m_DefineElement>
+
+ <inp2:p_PrintList render_as="product_compare_description" list_name="compare_products"/>
+
<div class="clear"></div>
</div>
+
<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>
+
<h3><a href="#">Details</a></h3>
- <div>
+ <div></div>
- </div>
<h3><a href="#">Specifications</a></h3>
- <div>
+ <div></div>
- </div>
<h3><a href="#">Overall Rating</a></h3>
- <div>
+ <div></div>
- </div>
<h3><a href="#">Reviews</a></h3>
- <div>
-
- </div>
+ <div></div>
</div>
<div class="clear"></div>
</div>
</div>
</inp2:m_DefineElement>
<!--## /MAIN CONTENT ##-->
<inp2:m_DefineElement name="add_to_head">
<script type= "text/javascript">
- $(function() {
- var icons = {
- header: "ui-icon-circle-arrow-e",
- headerSelected: "ui-icon-circle-arrow-s"
- };
- $( "#compare-menu" ).accordion({
- icons: icons,
- autoHeight: false,
- navigation: true
- });
- });
+ $(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++);
+ }
+ );
+
+ 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/elements/side_boxes/compare.elm.tpl
===================================================================
--- branches/1.0.x/elements/side_boxes/compare.elm.tpl (revision 14909)
+++ branches/1.0.x/elements/side_boxes/compare.elm.tpl (revision 14910)
@@ -1,60 +1,60 @@
<inp2:m_if check="m_Get" name="ajax" equals_to="yes">
<inp2:m_NoDebug/>
</inp2:m_if>
<inp2:m_Include template="elements/content_boxes.elm" strip_nl="2"/>
<inp2:m_Include template="elements/product_elements.elm" strip_nl="2"/>
-<inp2:p_InitList list_name="compare_products" types="compare" parent_cat_id="any" per_page="4"/>
+<inp2:p_InitList list_name="compare_products" types="compare" parent_cat_id="any" per_page="3"/>
<div class="block no-border-bottom" id="compare-products-sidebox"<inp2:m_ifnot check="p_TotalRecords" list_name="compare_products"> style="display: none;"</inp2:m_ifnot>>
<h2>
<em>Comparing Products (<inp2:p_TotalRecords list_name="compare_products"/>)</em>
<span class="bullet"></span>
</h2>
<div class="good-item border-radius-bottom comparing-items">
<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">
<a href="#"><img src="<inp2:m_TemplatesBase/>img/icon-delete.png" width="13" height="13" alt="" /></a>
</p>
</dd>
</dl>
</inp2:m_DefineElement>
<inp2:p_ListProducts list_name="compare_products" render_as="sidebox_product_element" no_table="1"/>
<p class="form buttons">
<input type="button" value="Compare" id="compare-products-btn" class="green-button" />&nbsp;&nbsp;&nbsp;
<input type="button" value="Clear" id="cancel-compare-btn" class="grey-button" />
</p>
</div>
</div>
<script type="text/javascript">
$(document).ready(
function () {
$('.addtocart', '#compare-products-sidebox').click(add_to_cart_handler);
$('#compare-products-btn').click(
function () {
redirect('<inp2:m_Link template="products/compare" js_escape="1"/>');
}
);
$('#cancel-compare-btn').click(
function () {
compare_product(0, 'OnCancelCompare');
}
);
}
);
</script>
\ No newline at end of file

Event Timeline