Created
June 7, 2017 05:16
-
-
Save SergeyZaigraev/914aef041c919ab4147b750ef7b4c91b to your computer and use it in GitHub Desktop.
Simple product price. Битрикс. Получить цену с учетом скидок на простой товар.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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