Answer the question
In order to leave comments, you need to log in
How to display the buy button in bitrix, which immediately leads to the checkout of the goods?
Good evening, tell me how to display a button to drink a certain product, when clicked, the user immediately led to the checkout of the product? (bep photo, product, no description, just a button to buy)
Answer the question
In order to leave comments, you need to log in
<?
$PRODUCT_ID = 30546; //ID товара или $arResult[ID] если шаблон детальной страницы.
if (CModule::IncludeModule("catalog")) {
if ($PRODUCT_ID) {
Add2BasketByProductID(
$PRODUCT_ID,
1, //количество товара
false
);
LocalRedirect("/cart/"); //ссылка на корзину
}
}
?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question