Favorites List Configuration in 1C-Bitrix
Favorites list (bookmarks, wishlist) — there's no standard built-in Bitrix component that implements full wishlist with database storage. Functionality is implemented via "Deferred Items" mechanism from sale module or via custom development using UserFieldManager or separate table.
Option 1: Deferred Items (Built-in Mechanism)
The sale module has built-in "deferred" basket items mechanism. Product is added to basket with flag DELAY = Y. Technically this is a row in b_sale_basket with deferred marker:
// Add product to deferred
$basket = \Bitrix\Sale\Basket::loadItemsForFUser(
\Bitrix\Sale\Fuser::getId()
);
$item = $basket->createItem('catalog', $productId);
$item->setFields([
'QUANTITY' => 1,
'DELAY' => 'Y',
'NAME' => $productName,
'PRICE' => $price,
'CURRENCY' => 'RUB',
]);
$basket->save();
Component bitrix:sale.basket.basket displays deferred items with parameter SHOW_DELAY = Y.
Drawback: deferred items are part of basket, not separate list. On basket clearing, they're lost.
Option 2: Custom Favorites List
For full functionality: storage between sessions, synchronization between devices, list independent from basket — need separate table or custom fields.
Table structure user_favorite_products:
CREATE TABLE user_favorite_products (
ID SERIAL PRIMARY KEY,
USER_ID INT NOT NULL,
PRODUCT_ID INT NOT NULL,
DATE_ADD TIMESTAMP DEFAULT NOW(),
UNIQUE(USER_ID, PRODUCT_ID)
);
ORM class via DataManager allows working with table via standard Bitrix API. AJAX endpoint for add/remove — via \Bitrix\Main\Engine\Controller.
For Guests: localStorage Storage
For unregistered users favorites list is more convenient to store in browser localStorage. On authorization — synchronize with database via AJAX. This is standard approach for modern stores.
Component and UI
"Add to Favorites" button is placed in product card and listing templates. Button state (added/not added) is managed by JavaScript class based on data passed to component or obtained via AJAX.
Timeframe
Favorites via deferred items mechanism — 2–4 hours. Full custom list with guest/authorized synchronization — 1–2 business days.







