A
A
a_palanski2018-05-11 19:36:12
1C-Bitrix
a_palanski, 2018-05-11 19:36:12

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

1 answer(s)
A
Anton, 2018-05-12
@anton99zel

<?
$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 question

Ask a Question

731 491 924 answers to any question