Advertisement
wzline

CIBlockElement::GetRealElement

Jul 4th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.08 KB | None | 0 0
  1.                 foreach ($offers_data[$model_id] as $id=>$offer) {
  2.                     $ELEMENT_ID = \CIBlockElement::GetRealElement($id);
  3.                     $arDiscounts = \CCatalogDiscount::GetDiscountByProduct(
  4.                         $ELEMENT_ID,
  5.                         array(1,2,3),
  6.                         "N",
  7.                         1,
  8.                         "s1"
  9.                     );
  10.  
  11.                     if ($arDiscounts[0]) {
  12.                         $mas_id[] = $ELEMENT_ID;
  13.                         \CIBlockElement::SetPropertyValues($ELEMENT_ID,
  14.                             OFFERS_IBLOCK_ID,
  15.                             "Y",
  16.                             "LABEL_SPEC_PRICE");
  17.                     } elseif (!$arDiscounts[0] && $offer["PROPERTIES"]["LABEL_SPEC_PRICE"]["VALUE"] == "Y") {
  18.                         \CIBlockElement::SetPropertyValues($ELEMENT_ID,
  19.                             OFFERS_IBLOCK_ID,
  20.                             "N",
  21.                             "LABEL_SPEC_PRICE");
  22.                     }
  23.                     $arDiscounts = "";
  24.                 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement