A
A
Artyom Suzenko2018-05-16 15:57:10
1C-Bitrix
Artyom Suzenko, 2018-05-16 15:57:10

How to make two prices for a product?

Hello!
Subject. What I found does not work(
I create a price type, specify it in the catalog component.
1: Where to write a new price?
2: How to display it in the catalog?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Ivanov, 2018-05-16
@CrewGer

To make two prices for one product, you need to use "Trading offers". If you want to use different types of prices (not to be confused with the price), then you must select these types of prices for display in the component settings and in the administrative section of the site, in the "Price Type" settings (where you created it), select for which users, what type will be displayed.
Price type
Trade offers
1) Copy the component template
2) Open template.php
3) If the project is working and users are already using the resource, display $arResult or $arItem under the admin (depending on which component you have). It's done like this

<?global $USER;
    if ($USER->IsAdmin()){?>
                      <pre><?print_r($arResult)?></pre>
             <?}?>

Search this array for your price types.
Next output
<?echo $arResult["PRICE"]["PRICE_1"]["VALUE"]?> 
     <?echo $arResult["PRICE"]["PRICE_2"]["VALUE"]?>  // у вас пути до значения и названия типа цен могут отличаться

Important! If you are using the complex catalog component. Then when creating a copy of the component template, the path to the required teamplate.php will be something like this:
/public_html/bitrix/templates/site template name/components/bitrix/catalog/component template name/bitrix/catalog.element/.default - for the product card
/ public_html/bitrix/templates/site template name/components/bitrix/catalog/component template name/bitrix/catalog.section/.default - for the list of products

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question