How to make two prices on the product?

Hello!
Subject. What I found is not working(

Create a rate type, specify it in the component directory.

1: Where to write the new price?
2: How to overcome it in the catalog?
June 5th 19 at 21:46
1 answer
June 5th 19 at 21:48
Solution
That would make two prices for one commodity, use the "Trade offer". If you want to use different types of prices ( not to be confused with price ) then you have in the component's settings to select these types of prices to display in the administrative section of the site, in the settings "Price Type" (where you create it) to choose which users, what type will be displayed.

Price type

Trade offers

1) Copy the template component
2) Open template.php
3) If the project is working, and users are already using online, print under admin $arResult or $arItem ( depending on which you have component ). This is done so

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


Look at this array of your types of price.

Then print

<?echo $arResult["PRICE"]["PRICE_1"]["VALUE"]?> 
 <?echo $arResult["PRICE"]["PRICE_2"]["VALUE"]?> // you have the path to the value and type name prices may vary


Important! If you use complex components directory. When creating a copy of the template component of the path to the desired teamplate.php will be something like this:

/public_html/bitrix/templates/the name of the site template/components/bitrix/catalog/template name of the component/bitrix/catalog.element/.default - for item cards

/public_html/bitrix/templates/the name of the site template/components/bitrix/catalog/template name of the component/bitrix/catalog.section/.default - product list
Types of currencies is selected, the user is specified - raises the new price instead of the base. How to bring them together? - kareem.Hans commented on June 5th 19 at 21:51
Will have to edit the template of the component.

1) Copy the template component
2) Open template.php
3) If the project is working, and users are already using online, print under admin $arResult or $arItem ( depending on which you have component ). This is done so

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


Look at this array of your types of price.

Then print

<?echo $arResult["PRICE"]["PRICE_1"]["VALUE"]?> 
 <?echo $arResult["PRICE"]["PRICE_2"]["VALUE"]?> // you have the path to the value and type name prices may vary


Important! If you use complex components directory. When creating a copy of the template component of the path to the desired teamplate.php will be something like this:

/public_html/bitrix/templates/the name of the site template/components/bitrix/catalog/template name of the component/bitrix/catalog.element/.default - for item cards

/public_html/bitrix/templates/the name of the site template/components/bitrix/catalog/template name of the component/bitrix/catalog.section/.default - product list - Eva.Fisher commented on June 5th 19 at 21:54
thank you! Tomorrow I will unsubscribe about results. - kareem.Hans commented on June 5th 19 at 21:57
It works , thank you! Tell me, so it would be correct technically?
<? if (!empty($arItem['CATALOG_PRICE_2']))
{ ?>
 <div class="bf-old-price" style="text-decoration: line-through;float: left;top: 5%;position: absolute;"><? echo number_format($arItem['CATALOG_PRICE_1'],'0',",' '); ?> RUB</div>
 <div class="buy-price bf-new-price"><? echo number_format($arItem['CATALOG_PRICE_2'],'0',",' '); ?> RUB</div>
 <? }
 else { ?>
<div class="buy-price"><? echo number_format($arItem['CATALOG_PRICE_1'],'0',",' '); ?> RUB</div>
 <div class="buy-price"></div>
<?} 
?>
- kareem.Hans commented on June 5th 19 at 22:00
, Yes, all right, I as would have done anyway ) Only styles better still write in style.css, what would the next developer doesn't spoil the karma myself, or you. - Eva.Fisher commented on June 5th 19 at 22:03
with styles in haste just. Thank You, Ivan! - kareem.Hans commented on June 5th 19 at 22:06
Always please ))) - Eva.Fisher commented on June 5th 19 at 22:09
Ivan , you can still You here to pull? How to remove a parameter from the filter Bitrix? - kareem.Hans commented on June 5th 19 at 22:12

Find more questions by tags 1C-Bitrix