Last active
August 29, 2015 14:07
-
-
Save morsvox/b1ca2333832110292913 to your computer and use it in GitHub Desktop.
Битрикс: Выводим сообщение о скидке на доставку
This file contains 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
$sale = CSaleDiscount::GetByID(4); | |
//Получаем позициюБольше либо равно в условии | |
$str = strripos($sale['UNPACK'], '>='); | |
//Обрезаем до этой позиции | |
$resPres = substr($sale['UNPACK'], $str+3); | |
//Получаем цифру для сравнения | |
$thisPrice = intval($resPres); | |
$str2 = strripos($sale['APPLICATION'], 'ApplyDelivery'); | |
$resPres2 = substr($sale['APPLICATION'], $str2+24); | |
$thisProcent = intval($resPres2); | |
$thisProcent = preg_replace('/[^0-9]/', '', $thisProcent); | |
$price = preg_replace('/[^0-9]/', '', $arResult['ORDER_PRICE_FORMATED']); | |
?> | |
<?if( $price >= $thisPrice):?> | |
<br><span style="color: red;">(<?=$thisProcent?>% скидка на доставку)</span> | |
<?endif;?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment