Skip to content

Instantly share code, notes, and snippets.

@d1i1m1o1n
Created November 15, 2015 20:08
Show Gist options
  • Save d1i1m1o1n/4ff5df3cfb5405a3f8ce to your computer and use it in GitHub Desktop.
Save d1i1m1o1n/4ff5df3cfb5405a3f8ce to your computer and use it in GitHub Desktop.
Bitrix add product to viewed list
//добавление товара в просмотренные
use \Bitrix\Catalog\CatalogViewedProductTable as CatalogViewedProductTable;
$user_id = CSaleBasket::GetBasketUserID();
if($user_id > 0) {
$product_id = $arResult['ID'];
CatalogViewedProductTable::refresh($product_id, $user_id);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment