Last active
August 7, 2016 08:00
-
-
Save crusat/9ba28140c75de7b029b1b0fd3baa9cc1 to your computer and use it in GitHub Desktop.
Bitrix print price for product (based on http://dev.1c-bitrix.ru/support/forum/messages/forum6/topic35628/message196613/#message196613 )
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
<?php | |
function getPrice($productId) { | |
$result = ''; | |
$PRICE_TYPE_ID = 1; # just example, see in admin panel | |
$rsPrices = CPrice::GetList(array(), array('PRODUCT_ID' => $productId, 'CATALOG_GROUP_ID' => $PRICE_TYPE_ID)); | |
if ($arPrice = $rsPrices->Fetch()) | |
{ | |
$result = CurrencyFormat($arPrice["PRICE"], $arPrice["CURRENCY"]); | |
} | |
return $result; | |
} | |
# using | |
echo getPrice(1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment