Created
May 31, 2017 05:26
-
-
Save qwersk/a567b6c8a0016c6cfa3159df4389b851 to your computer and use it in GitHub Desktop.
GET ELEMENT VIEW COUNTER #BITRIX
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
| $view_counter = 0; | |
| if(CModule::IncludeModule("iblock")){ | |
| CIBlockElement::CounterInc($item["ID"]); | |
| $res = CIBlockElement::GetByID($item["ID"]); | |
| if($ar_res = $res->GetNext()){ | |
| $view_counter = $ar_res['SHOW_COUNTER']; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment