Advertisement
SpeakeazyYT

Untitled

Aug 6th, 2018
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.31 KB | None | 0 0
  1. <?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();?>
  2. <?
  3. $sticker = "";
  4. if (array_key_exists("PROPERTIES", $arResult) && is_array($arResult["PROPERTIES"]))
  5. {
  6. foreach (Array("SPECIALOFFER", "NEWPRODUCT", "SALELEADER") as $propertyCode)
  7. if (array_key_exists($propertyCode, $arResult["PROPERTIES"]) && intval($arResult["PROPERTIES"][$propertyCode]["PROPERTY_VALUE_ID"]) > 0)
  8. {
  9. $sticker = toLower($arResult["PROPERTIES"][$propertyCode]["NAME"]);
  10. break;
  11. }
  12. }
  13. ?>
  14. <div class="detail_item">
  15. <?if(is_array($arResult["PREVIEW_PICTURE"]) || is_array($arResult["DETAIL_PICTURE"])):?>
  16. <div class="detail_item_img_container" <?if (!empty($arResult["PHOTO_GALLERY"])):?>onclick="showPhoto(<?=CUtil::PhpToJsObject($arResult["PHOTO_GALLERY"])?>, '<?=$arResult["NAME"]?>')"<?endif?>>
  17. <a class="detail_item_img" href="javascript:void(0)">
  18. <?if(is_array($arResult["DETAIL_PICTURE_SMALL"])):?>
  19. <img id="catalog_detail_image" src="<?=$arResult["DETAIL_PICTURE_SMALL"]["SRC"]?>" alt="<?=$arResult["NAME"]?>" title="<?=$arResult["NAME"]?>" />
  20. <?elseif(is_array($arResult["PREVIEW_PICTURE"])):?>
  21. <img id="catalog_detail_image" src="<?=$arResult["PREVIEW_PICTURE"]["SRC"]?>" alt="<?=$arResult["NAME"]?>" title="<?=$arResult["NAME"]?>" />
  22. <?endif?>
  23. </a>
  24. <!-- <span class="detail_item_img_lupe"></span> -->
  25. </div>
  26. <?endif;?>
  27. <h2 class="detail_item_title">
  28. <a href="<?=$arResult["DETAIL_PAGE_URL"]?>" title="<?=$arResult["NAME"]?>"><?=$arResult["NAME"]?></a>
  29. <?if ($sticker):?><br/><span style="color:#9b0000; font-size: 14px;"><?=$sticker?></span><?endif?>
  30. </h2>
  31.  
  32. <?if(!is_array($arResult["OFFERS"]) || empty($arResult["OFFERS"])):?>
  33. <?foreach($arResult["PRICES"] as $code=>$arPrice):?>
  34. <?if($arPrice["CAN_ACCESS"]):?>
  35. <?//=$arResult["CAT_PRICES"][$code]["TITLE"];?>
  36. <?if($arPrice["DISCOUNT_VALUE"] < $arPrice["VALUE"]):?>
  37. <div class="detail_price_container oldprice">
  38. <span class="item_price"><?=$arPrice["PRINT_DISCOUNT_VALUE"]?></span><br />
  39. <span class="item_price_old"><?=$arPrice["PRINT_VALUE"]?></span>
  40. </div>
  41. <?else:?>
  42. <div class="detail_price_container">
  43. <span class="item_price"><?=$arPrice["PRINT_VALUE"]?></span>
  44. </div>
  45. <?endif;?>
  46. <div class="detail_price_container">
  47. <span>
  48.  
  49. </span>
  50. </div>
  51. <?endif;?>
  52. <?endforeach;?>
  53.  
  54. <?if($arResult["CAN_BUY"]):?>
  55. <?if($arParams["USE_PRODUCT_QUANTITY"]):?>
  56. <div class="clb"></div>
  57. <div class="detail_item_buy_container">
  58. <form action="<?=POST_FORM_ACTION_URI?>" id="quantity_form" method="post" enctype="multipart/form-data" >
  59. <div class="detail_item_count">
  60. <a href="javascript:void(0)" class="count_minus" id="count_minus" ontouchstart="if (BX('item_quantity').value > 1) BX('item_quantity').value--;"><span></span></a>
  61. <input type="number" id="item_quantity" name="<?echo $arParams["PRODUCT_QUANTITY_VARIABLE"]?>" value="1">
  62. <a href="javascript:void(0)" class="count_plus" id="count_plus" ontouchstart="BX('item_quantity').value++;"><span></span></a>
  63. </div>
  64. <input type="hidden" name="<?echo $arParams["ACTION_VARIABLE"]?>" value="ADD2BASKET">
  65. <input type="hidden" name="<?echo $arParams["PRODUCT_ID_VARIABLE"]?>" value="<?echo $arResult["ID"]?>">
  66. <a class="detail_item_buykey button_red_medium" ontouchstart="BX.toggleClass(this, 'active');" ontouchend="BX.toggleClass(this, 'active');" href="javascript:void(0)" onclick="
  67. BX.addClass(BX.findParent(this, {class : 'detail_item'}, false), 'add2cart');
  68. app.onCustomEvent('onItemBuy', {});
  69. BX.ajax({
  70. timeout: 30,
  71. method: 'POST',
  72. url: '<?=CUtil::JSEscape(POST_FORM_ACTION_URI)?>',
  73. processData: false,
  74. data: {
  75. <?echo $arParams["ACTION_VARIABLE"]?>: 'ADD2BASKET',
  76. <?echo $arParams["PRODUCT_ID_VARIABLE"]?>: '<?echo $arResult["ID"]?>',
  77. <?echo $arParams["PRODUCT_QUANTITY_VARIABLE"]?>: BX('quantity_form').elements['<?echo $arParams["PRODUCT_QUANTITY_VARIABLE"]?>'].value
  78. },
  79. onsuccess: function(reply){
  80. },
  81. onfailure: function(){
  82. }
  83. });
  84. return BX.PreventDefault(event);
  85. "><?echo GetMessage("CATALOG_BUY")?></a>
  86. <a class="detail_item_buykey_cartlink button_yellow_small" href="<?echo $arParams["BASKET_URL"]?>" rel="nofollow"><?echo GetMessage("CATALOG_IN_CART")?></a>
  87. </form>
  88. </div>
  89.  
  90. <?else:?>
  91. <div class="detail_item_buy_container">
  92. <noindex>
  93. <a class="detail_item_buykey button_red_medium" ontouchstart="BX.toggleClass(this, 'active');" ontouchend="BX.toggleClass(this, 'active');" href="<?echo $arResult["ADD_URL"]?>" onclick="
  94. BX.addClass(BX.findParent(this, {class : 'detail_item'}, false), 'add2cart');
  95. return addItemToCart(this);" rel="nofollow"><?echo GetMessage("CATALOG_BUY")?></a>
  96. <a class="detail_item_buykey_cartlink button_yellow_small" href="<?echo $arParams["BASKET_URL"]?>" rel="nofollow"><?echo GetMessage("CATALOG_IN_CART")?></a>
  97. </noindex>
  98. </div>
  99. <?endif;?>
  100.  
  101.  
  102. <?if(count($arResult["MORE_PHOTO"])>0):?>
  103. <div class="detail_item_gallery" onclick="showPhoto(<?=CUtil::PhpToJsObject($arResult["PHOTO_GALLERY"])?>, '<?=$arResult["NAME"]?>')">
  104. <div class="detail_item_gallery_topborder"></div>
  105. <span class="detail_item_gallery_left"></span>
  106. <div class="detail_item_gallery_tcontainer">
  107. <ul>
  108. <?foreach($arResult["MORE_PHOTO"] as $photo):?>
  109. <li><a href="javascript:void(0)"><span><img src="<?=$photo["SRC"]?>" alt=""></span></a></li>
  110. <?endforeach?>
  111. </ul>
  112. </div>
  113. <div class="clb"></div>
  114. <span class="detail_item_gallery_right"></span>
  115. </div>
  116. <?endif?>
  117.  
  118. <?/*elseif((count($arResult["PRICES"]) > 0) || is_array($arResult["PRICE_MATRIX"])):?>
  119. <?=GetMessage("CATALOG_NOT_AVAILABLE")?>
  120. <?$APPLICATION->IncludeComponent("bitrix:sale.notice.product", ".default", array(
  121. "NOTIFY_ID" => $arResult['ID'],
  122. "NOTIFY_PRODUCT_ID" => $arParams['PRODUCT_ID_VARIABLE'],
  123. "NOTIFY_ACTION" => $arParams['ACTION_VARIABLE'],
  124. "NOTIFY_URL" => htmlspecialcharsback($arResult["SUBSCRIBE_URL"]),
  125. "NOTIFY_USE_CAPTHA" => "N"
  126. ),
  127. $component
  128. );?>
  129. <?*/endif?>
  130. <?endif;?>
  131. </div>
  132.  
  133. <?/*if(is_array($arResult["OFFERS"]) && !empty($arResult["OFFERS"])):/*?>
  134. <?foreach($arResult["OFFERS"] as $arOffer):?>
  135. <?foreach($arParams["OFFERS_FIELD_CODE"] as $field_code):?>
  136. <small><?echo GetMessage("IBLOCK_FIELD_".$field_code)?>:&nbsp;<?
  137. echo $arOffer[$field_code];?></small><br />
  138. <?endforeach;?>
  139. <?foreach($arOffer["DISPLAY_PROPERTIES"] as $pid=>$arProperty):?>
  140. <small><?=$arProperty["NAME"]?>:&nbsp;<?
  141. if(is_array($arProperty["DISPLAY_VALUE"]))
  142. echo implode("&nbsp;/&nbsp;", $arProperty["DISPLAY_VALUE"]);
  143. else
  144. echo $arProperty["DISPLAY_VALUE"];?></small><br />
  145. <?endforeach?>
  146. <?foreach($arOffer["PRICES"] as $code=>$arPrice):?>
  147. <?if($arPrice["CAN_ACCESS"]):?>
  148. <p><?=$arResult["CAT_PRICES"][$code]["TITLE"];?>:&nbsp;&nbsp;
  149. <?if($arPrice["DISCOUNT_VALUE"] < $arPrice["VALUE"]):?>
  150. <s><?=$arPrice["PRINT_VALUE"]?></s> <span class="catalog-price"><?=$arPrice["PRINT_DISCOUNT_VALUE"]?></span>
  151. <?else:?>
  152. <span class="catalog-price"><?=$arPrice["PRINT_VALUE"]?></span>
  153. <?endif?>
  154. </p>
  155. <?endif;?>
  156. <?endforeach;?>
  157. <p>
  158. <?if($arParams["DISPLAY_COMPARE"]):?>
  159. <noindex>
  160. <a href="<?echo $arOffer["COMPARE_URL"]?>" rel="nofollow"><?echo GetMessage("CT_BCE_CATALOG_COMPARE")?></a>&nbsp;
  161. </noindex>
  162. <?endif?>
  163. <?if($arOffer["CAN_BUY"]):?>
  164. <?if($arParams["USE_PRODUCT_QUANTITY"]):?>
  165. <form action="<?=POST_FORM_ACTION_URI?>" method="post" enctype="multipart/form-data">
  166. <table border="0" cellspacing="0" cellpadding="2">
  167. <tr valign="top">
  168. <td><?echo GetMessage("CT_BCE_QUANTITY")?>:</td>
  169. <td>
  170. <input type="text" name="<?echo $arParams["PRODUCT_QUANTITY_VARIABLE"]?>" value="1" size="5">
  171. </td>
  172. </tr>
  173. </table>
  174. <input type="hidden" name="<?echo $arParams["ACTION_VARIABLE"]?>" value="BUY">
  175. <input type="hidden" name="<?echo $arParams["PRODUCT_ID_VARIABLE"]?>" value="<?echo $arOffer["ID"]?>">
  176. <input type="submit" name="<?echo $arParams["ACTION_VARIABLE"]."BUY"?>" value="<?echo GetMessage("CATALOG_BUY")?>">
  177. <input type="submit" name="<?echo $arParams["ACTION_VARIABLE"]."ADD2BASKET"?>" value="<?echo GetMessage("CT_BCE_CATALOG_ADD")?>">
  178. </form>
  179. <?else:?>
  180. <noindex>
  181. <a href="<?echo $arOffer["BUY_URL"]?>" rel="nofollow"><?echo GetMessage("CATALOG_BUY")?></a>
  182. &nbsp;<a href="<?echo $arOffer["ADD_URL"]?>" rel="nofollow"><?echo GetMessage("CT_BCE_CATALOG_ADD")?></a>
  183. </noindex>
  184. <?endif;?>
  185. <?elseif(count($arResult["CAT_PRICES"]) > 0):?>
  186. <?=GetMessage("CATALOG_NOT_AVAILABLE")?>
  187. <?$APPLICATION->IncludeComponent("bitrix:sale.notice.product", ".default", array(
  188. "NOTIFY_ID" => $arOffer['ID'],
  189. "NOTIFY_URL" => htmlspecialcharsback($arOffer["SUBSCRIBE_URL"]),
  190. "NOTIFY_USE_CAPTHA" => "N"
  191. ),
  192. $component
  193. );?>
  194. <?endif?>
  195. </p>
  196. <?endforeach;?>
  197. <?else:?>
  198.  
  199. <?endif*/?>
  200.  
  201. <?if ($arResult["DETAIL_TEXT"] || $arResult["PREVIEW_TEXT"]):?>
  202. <div class="detail_item_description <?if (!CMobile::getInstance()->isLarge()) echo "close";?>" >
  203. <h3 onclick="OpenClose(BX(this).parentNode)"><?=GetMessage("CATALOG_FULL_DESC")?> <span class="detail_item_arrow"></span></h3>
  204. <div class="detail_item_description_text">
  205. <?if($arResult["DETAIL_TEXT"]):?>
  206. <br /><?=$arResult["DETAIL_TEXT"]?><br />
  207. <?elseif($arResult["PREVIEW_TEXT"]):?>
  208. <br /><?=$arResult["PREVIEW_TEXT"]?><br />
  209. <?endif;?>
  210. </div>
  211. </div>
  212. <?endif?>
  213.  
  214. <?if (is_array($arResult['DISPLAY_PROPERTIES']) && count($arResult['DISPLAY_PROPERTIES']) > 0)
  215. {
  216. $arPropertyRecommend = $arResult["DISPLAY_PROPERTIES"]["RECOMMEND"];
  217. unset($arResult["DISPLAY_PROPERTIES"]["RECOMMEND"]);
  218. if (is_array($arResult['DISPLAY_PROPERTIES']) && count($arResult['DISPLAY_PROPERTIES']) > 0):?>
  219. <div class="detail_item_description info <?if (!CMobile::getInstance()->isLarge()) echo "close";?>">
  220. <h3 onclick="OpenClose(BX(this).parentNode)"><?=GetMessage("CATALOG_PROPERTIES")?> <span class="detail_item_arrow"></span></h3>
  221. <div class="detail_item_description_text">
  222. <ul>
  223. <?foreach($arResult["DISPLAY_PROPERTIES"] as $pid=>$arProperty):?>
  224. <li>
  225. <table>
  226. <tr>
  227. <td class="detail_item_feature"><span><?=$arProperty["NAME"]?>:</span></td>
  228. <td class="detail_item__featurevalue"><span>
  229. <?if(is_array($arProperty["DISPLAY_VALUE"])):
  230. echo implode(" / ", $arProperty["DISPLAY_VALUE"]);
  231. elseif($pid=="MANUAL"):
  232. ?><a href="<?=$arProperty["VALUE"]?>"><?=GetMessage("CATALOG_DOWNLOAD")?></a><?
  233. else:
  234. echo $arProperty["DISPLAY_VALUE"];?>
  235. <?endif?>
  236. </span></td>
  237. </tr>
  238. </table>
  239. </li>
  240. <?endforeach?>
  241. </ul>
  242. </div>
  243. </div>
  244. <?endif;
  245. }
  246. ?>
  247. <script type="text/javascript">
  248. app.setPageTitle({"title" : "<?=CUtil::JSEscape(htmlspecialcharsback($arResult["NAME"]))?>"});
  249. function showPhoto(arPhotos, descr)
  250. {
  251. var photos = [];
  252. for (var i=0; i<arPhotos.length; i++)
  253. {
  254. photos[i] = {url : arPhotos[i], description : descr};
  255. }
  256. app.openPhotos({
  257. "photos": photos
  258. });
  259. }
  260. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement