Documentation

Basket

\Bitrix\Catalog\Product\Basket class for adding products into shopping cart.

Class works only with physical products and always require available PRODUCT_ID in contrast to \Bitrix\Sale\Basket. Additionally, when adding to shopping cart via \Bitrix\Catalog\Product\Basket, checks activity, access permissions, product type and etc. It is not done by shopping cart methods.

Class methods

MethodDescription Available from version
addProductAdds product to current user's shopping cart (not an order) at the site. Developed for public components as replacement for function Add2BasketByProductID.
addProductToBasketAdds product to arbitrary shopping cart without access permission check for current user.
addProductToBasketWithPermissionsAdds product to arbitrary shopping cart with access permission check for current user.
isNotCrawlerReturns a check result that confirms that user is not a web crawler.


© «Bitrix24», 2001-2024