Page MenuHomeIn-Portal Phabricator

modern-store
No OneTemporary

File Metadata

Created
Tue, Apr 29, 2:01 PM

modern-store

Index: branches/1.0.x/products/compare.tpl
===================================================================
--- branches/1.0.x/products/compare.tpl (revision 14918)
+++ branches/1.0.x/products/compare.tpl (revision 14919)
@@ -1,164 +1,196 @@
<!--##
<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>
</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"/>
- <inp2:m_if check="p_TotalRecords" list_name="compare_products" equals_to="0|1|2">
- <div class="good-item last-child">
- <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>
- </inp2:m_if>
+ <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;">
- <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>
+ <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>
- </div>
- </inp2:m_DefineElement>
+ </inp2:m_DefineElement>
- <inp2:p_PrintList render_as="product_compare_description" list_name="compare_products"/>
+ <inp2:p_PrintList render_as="product_compare_description" list_name="compare_products"/>
- <div class="clear"></div>
- </div>
+ <div class="clear"></div>
+ </div>
+ </inp2:m_if>
- <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>
+ <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>
- </div>
- </inp2:m_DefineElement>
+ </inp2:m_DefineElement>
- <inp2:p_PrintList render_as="product_compare_features" list_name="compare_products"/>
+ <inp2:p_PrintList render_as="product_compare_features" list_name="compare_products"/>
+
+ <div class="clear"></div>
+ </div>
+ </inp2:m_if>
- <div class="clear"></div>
- </div>
- <h3><a href="#">Details</a></h3>
+ <!--<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>
+ <div></div>-->
- <h3><a href="#">Reviews</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/elements/side_boxes/compare.elm.tpl
===================================================================
--- branches/1.0.x/elements/side_boxes/compare.elm.tpl (revision 14918)
+++ branches/1.0.x/elements/side_boxes/compare.elm.tpl (revision 14919)
@@ -1,43 +1,43 @@
<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="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:p_ListProducts list_name="compare_products" render_as="compare_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"/>');
+ redirect('<inp2:p_CompareLink template="products/compare" js_escape="1"/>');
}
);
$('#cancel-compare-btn').click(
function () {
compare_product(0, 'OnCancelCompare');
}
);
}
);
</script>
\ No newline at end of file

Event Timeline