P
P
pavelmosin2019-07-09 15:59:44
1C-Bitrix
pavelmosin, 2019-07-09 15:59:44

Bitrix. How to get $request->getPost("id")?

This code works (as I understand it) when ordering goods in init.php

use Bitrix\Sale,
   Bitrix\Main\Application;

$request = Application::getInstance()->getContext()->getRequest();

$basket = Sale\Basket::loadItemsForFUser(Sale\Fuser::getId(), Bitrix\Main\Context::getCurrent()->getSite());
<b>$productId = intval( $request->getPost("id") )</b>;

$request->getPost("id") - how to get this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Panteleev, 2019-07-09
@pavelmosin

This code works by itself, conditions like adding to cart are not defined here
receives a request object
under normal conditions is similar$_POST['id']
and this piece of code is not shown in any way
make a POST request to this page with the id parameter

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question