Skip to content

Instantly share code, notes, and snippets.

@SergeyZaigraev
Created June 7, 2017 05:16
Show Gist options
  • Save SergeyZaigraev/914aef041c919ab4147b750ef7b4c91b to your computer and use it in GitHub Desktop.
Save SergeyZaigraev/914aef041c919ab4147b750ef7b4c91b to your computer and use it in GitHub Desktop.
Simple product price. Битрикс. Получить цену с учетом скидок на простой товар.
$price = CCatalogProduct::GetOptimalPrice($getElemData['ID'], 1, $USER->GetUserGroupArray(), 'N');
$arDiscounts = CCatalogDiscount::GetDiscountByProduct($getElemData['ID'], $USER->GetUserGroupArray(), "N", array(),SITE_ID);
if(is_array($arDiscounts) && sizeof($arDiscounts) > 0) {
$final_price = CCatalogProduct::CountPriceWithDiscount($price['PRICE']['PRICE'], $price['PRICE']['CURRENCY'], $arDiscounts);
$this->arResult['PRODUCT']['PRICE'] = CCurrencyLang::CurrencyFormat($final_price,$price['PRICE']['CURRENCY']);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment