Guest User

Untitled

a guest
Apr 3rd, 2013
112
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?
  2. global $USER;
  3. $arGroups = CUser::GetUserGroup($USER->GetID());
  4. $who_access = in_array('7', $arGroups);
  5. ?>
  6.  
  7. <?$numProps = count($arResult["SKU_PROPERTIES"]);
  8.     foreach ($arResult["SKU_ELEMENTS"] as $key => $arSKU) {
  9.         if($arSKU[0] == $who_access){
  10.             //whosales
  11.             $arResult["SKUEL"] = $arResult["SKU_ELEMENTS"][$key-1];
  12.         }else{
  13.             $arResult["SKUEL"] = $arResult["SKU_ELEMENTS"][$key];
  14.         }  
  15.        
  16.     }
  17. ?>
  18. <?if($who_access == 1):?>
  19.     <?if (intval($arResult["SKUEL"]["DISCOUNT_PRICE"]) > 0 && $arResult["SKUEL"]["PRICE"] > 0):?>
  20.         <p class="price"><?=$arResult["SKUEL"]["DISCOUNT_PRICE"]?></p><span class="old-price"><?=$arResult["SKUEL"]["PRICE"]?></span>
  21.     <?else:?>
  22.         <p class="price"><?=$arResult["SKUEL"]["PRICE"]?></p>
  23.     <?endif?>
  24.     <p class="retail-price">Розничная цена: <strong><?=$arResult["PRICES"]["BASE"]["VALUE"]?> руб</strong>
  25.     <p class="detail-text"><?=strip_tags($arResult["~PREVIEW_TEXT"])?></p>
  26.     <select id="colors" name="COLOR">
  27.         <?
  28.         $aRcolors = explode("/",$arResult["SKUEL"]["3"]);
  29.         foreach ($aRcolors as $key => $color) {
  30.             echo "<option>".$color."</option>";
  31.         }
  32.         ?>
  33.     </select>
  34.     <p>Размеры в упаковке: <?=$arResult["SKUEL"]["1"]?></p>
  35.     <a href="<?=$arResult["SKUEL"]["ADD_URL"]?>" onclick="return addToCart(this, 'detail', '<?=GetMessage("CATALOG_IN_CART")?>', 'noButton');" id="catalog_add2cart_link_ofrs_<?=$arResult["SKUEL"]["ID"]?>"><?=GetMessage("CATALOG_BUY")?></a>
  36. <?else:?>
  37.     <?if (intval($arResult["SKUEL"]["DISCOUNT_PRICE"]) > 0 && $arResult["SKUEL"]["PRICE"] > 0):?>
  38.         <p class="price"><?=$arResult["SKUEL"]["DISCOUNT_PRICE"]?></p><span class="old-price"><?=$arResult["SKUEL"]["PRICE"]?></span>
  39.     <?else:?>
  40.         <p class="price"><?=$arResult["SKUEL"]["PRICE"]?></p>
  41.     <?endif?>
  42.     <p class="detail-text"><?=strip_tags($arResult["~PREVIEW_TEXT"])?></p>
  43.     <select id="colors">
  44.         <?
  45.         $aRcolors = explode("/",$arResult["SKUEL"]["3"]);
  46.         foreach ($aRcolors as $key => $color) {
  47.             echo "<option>".$color."</option>";
  48.         }
  49.         ?>
  50.     </select>
  51.     <select id="size">
  52.         <?
  53.         $aRsizes = explode("/",$arResult["SKUEL"]["2"]);
  54.         foreach ($aRsizes as $key => $size) {
  55.             echo "<option>".$size."</option>";
  56.         }
  57.         ?>
  58.     </select>
  59.     <a href="<?=$arResult["SKUEL"]["ADD_URL"]?>" onclick="return addToCart(this, 'detail', '<?=GetMessage("CATALOG_IN_CART")?>', 'noButton');" id="catalog_add2cart_link_ofrs_<?=$arResult["SKUEL"]["ID"]?>"><?=GetMessage("CATALOG_BUY")?></a>
  60. <?endif?>
RAW Paste Data