Simindey
2/15/2017 - 6:39 PM

Компонент сравнения товара (Таблица сравнения) Один размещаем на странице того товара который будет участвовать в сравнении //bitrix:catalog

Компонент сравнения товара (Таблица сравнения) Один размещаем на странице того товара который будет участвовать в сравнении //bitrix:catalog.compare.list Второй где будет таблица сравнения // bitrix:catalog.compare.result все товары хранятся в сессии //$SESSION["имя списка сравниваемых элементов"]["ID информационного блока"]["ITEMS"]["ID элемента"]

<?$APPLICATION->IncludeComponent(
	"bitrix:catalog.compare.result", 
	".default", 
	array(
		"COMPONENT_TEMPLATE" => ".default",
		"NAME" => "CATALOG_COMPARE_LIST",
		"IBLOCK_TYPE" => "vjweb_bigfirm_catalogs",
		"IBLOCK_ID" => "",
		"FIELD_CODE" => array(
			0 => "NAME",
			1 => "PREVIEW_TEXT",
			2 => "DETAIL_PICTURE",
		),
		"PROPERTY_CODE" => array(
			0 => "",
			1 => "",
		),
		"ELEMENT_SORT_FIELD" => "sort",
		"ELEMENT_SORT_ORDER" => "asc",
		"TEMPLATE_THEME" => "blue",
		"AJAX_MODE" => "N",
		"AJAX_OPTION_JUMP" => "N",
		"AJAX_OPTION_STYLE" => "Y",
		"AJAX_OPTION_HISTORY" => "N",
		"AJAX_OPTION_ADDITIONAL" => "",
		"DETAIL_URL" => "",
		"SECTION_ID_VARIABLE" => "SECTION_ID",
		"DISPLAY_ELEMENT_SELECT_BOX" => "N",
		"ELEMENT_SORT_FIELD_BOX" => "name",
		"ELEMENT_SORT_ORDER_BOX" => "asc",
		"ELEMENT_SORT_FIELD_BOX2" => "id",
		"ELEMENT_SORT_ORDER_BOX2" => "desc",
		"HIDE_NOT_AVAILABLE" => "N",
		"ACTION_VARIABLE" => "action",
		"PRODUCT_ID_VARIABLE" => "id",
		"PRICE_CODE" => array(
			0 => "BASE",
		),
		"USE_PRICE_COUNT" => "N",
		"SHOW_PRICE_COUNT" => "1",
		"PRICE_VAT_INCLUDE" => "Y",
		"CONVERT_CURRENCY" => "N",
		"BASKET_URL" => "/personal/basket.php"
	),
	false
);?>
//удаляем элементы из списка
BX.ready(function(){
	var count = $("div.jcf-scrollable").children(".catalog_comp_block").length;
	$('a.delete').on("click", function(){
		if(count == 1)
			$('.clearfix').html('');
		else
			$(this).parent('.catalog_comp_block').addClass('disable_prop');
	count--;
	});
});
<?$APPLICATION->IncludeComponent(
	"bitrix:catalog.compare.list", 
	".default", 
	array(
		"ACTION_VARIABLE" => "action",
		"AJAX_MODE" => "Y",
		"AJAX_OPTION_ADDITIONAL" => "",
		"AJAX_OPTION_HISTORY" => "N",
		"AJAX_OPTION_JUMP" => "N",
		"AJAX_OPTION_STYLE" => "Y",
		"COMPARE_URL" => "/catalog/compare.php",
		"COMPONENT_TEMPLATE" => ".default",
		"DETAIL_URL" => "",
		"IBLOCK_ID" => "4",
		"IBLOCK_TYPE" => "vjweb_bigfirm_catalogs",
		"NAME" => "CATALOG_COMPARE_LIST",
		"POSITION" => "top left",
		"POSITION_FIXED" => "Y",
		"PRODUCT_ID_VARIABLE" => "id"
	),
	false
);