Answer the question
In order to leave comments, you need to log in
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>;
Answer the question
In order to leave comments, you need to log in
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 questionAsk a Question
731 491 924 answers to any question