S
S
symply_rabbit2019-03-14 20:58:08
1C-Bitrix
symply_rabbit, 2019-03-14 20:58:08

Bitrix api price output, what could be wrong?

Good afternoon! I'm trying to display the price using api, but it shows the wrong one... The price is not the base one. euro currency. export using product id

$ID = 908;
$arPrice = CPrice::GetByID($ID);
echo "Цена типа ".$arPrice["CATALOG_GROUP_NAME"].
     " на товар с кодом ".$ID.": ";
echo CurrencyFormat($arPrice["PRICE"], 
                    $arPrice["CURRENCY"])."<br>";
echo "Вы ".(($arPrice["CAN_ACCESS"]=="Y") ? 
            "можете" : 
            "не можете")." видеть эту цену";

as a result, the product in the card shows 8 euros, and according to this code it shows the alleged price of this product is € 2.95.
is my code correct?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artyom Luchnikov, 2019-03-14
@symply_rabbit

CPrice::GetByID takes a price ID, and you pass in the product ID.
Can get the price by product id like this Cprice::GetBasePrice($ID);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question