Page MenuHomeIn-Portal Phabricator

compare.elm.tpl
No OneTemporary

File Metadata

Created
Tue, Sep 2, 10:12 AM

compare.elm.tpl

<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"/>
<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:p_CompareLink template="products/compare" js_escape="1"/>');
}
);
$('#cancel-compare-btn').click(
function () {
compare_product(0, 'OnCancelCompare');
}
);
$('.button-delete', '#compare-products-sidebox').click(
function ($e) {
compare_product($(this).attr('product_id'), false);
return false;
}
);
<inp2:m_if check="m_Get" name="result">
var $compare_checkbox = $(".compare-checkbox[value='<inp2:m_Get name="p_id" js_escape="1"/>']", '#products');
<inp2:m_if check="m_Get" name="result" equals_to="added">
create_tooltip($compare_checkbox, 'Added to Comparison', 'formSuccess');
</inp2:m_if>
<inp2:m_if check="m_Get" name="result" equals_to="removed">
create_tooltip($compare_checkbox, 'Removed from Comparison', 'formNeutral');
$compare_checkbox.prop('checked', false);
</inp2:m_if>
<inp2:m_if check="m_Get" name="result" equals_to="error">
create_tooltip($compare_checkbox, 'Up to <inp2:m_GetConfig name="MaxCompareProducts"/> products can be compared', 'formError');
$compare_checkbox.prop('checked', false);
</inp2:m_if>
<inp2:m_if check="m_Get" name="result" equals_to="all_removed">
$(".compare-checkbox:checked", '#products')
.each(
function () {
var $me = $(this);
create_tooltip($me, 'Removed from Comparison', 'formNeutral');
$me.prop('checked', false);
}
);
</inp2:m_if>
</inp2:m_if>
}
);
</script>

Event Timeline