$queryUrl = 'https://api.vk.com/method/groups.getLongPollServer';
$queryData = http_build_query(array(
"group_id" =>123,
"access_token"=>321,
"access_token"=> 333
));
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_SSL_VERIFYPEER => 0,
CURLOPT_POST => 0,
CURLOPT_HEADER => 0,
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => $queryUrl,
CURLOPT_POSTFIELDS => $queryData,
));
$result = curl_exec($curl);
curl_close($curl);
<div class="modalText" style="display: none;">Любой текст</div>
$('a#service-price').click( function(event){
var getHtml = $(this).next(".modalText").html();
event.preventDefault();
$('#service-overlay').fadeIn(400,
function(){
$('#service-modal').html(getHtml);
$('#service-modal')
.css('display', 'block')
.animate({opacity: 1, top: '5%'}, 200);
});
});
echo "<pre>";
print_r($arResult["DISPLAY_PROPERTIES"]["OBJ_VIDEO"]);
echo "</pre>";
@foreach($category as $categories)
@foreach($post->category as $selected)
@if($selected->title == $categories->title)
<input type="checkbox" aria-label="{{$categories->title}}" value="{{$categories->title}}" name="category[{{$categories->id}}]" checked> {{$categories->title}}
@endif
@endforeach
@endforeach
$params = array('entity_type' => 'LEAD', 'type' => 'PHONE', 'values' => array('55-58-88'))
"ELEMENT_SORT_FIELD" => $arParams["ELEMENT_SORT_FIELD"],
"ELEMENT_SORT_ORDER" => $arParams["ELEMENT_SORT_ORDER"],
"ELEMENT_SORT_FIELD2" => $arParams["ELEMENT_SORT_FIELD2"],
"ELEMENT_SORT_ORDER2" => $arParams["ELEMENT_SORT_ORDER2"],
"ELEMENT_SORT_FIELD" => "ID",
"ELEMENT_SORT_ORDER" => "DESC",
"ELEMENT_SORT_FIELD2" => "ID",
"ELEMENT_SORT_ORDER2" => "DESC",
global $arrFilter;
$arrFilter = array("CREATED_BY"=>"ID_НУЖНОГО-ПОЛЬЗОВАТЕЛЯ");
global $arrFilter, $USER;
$arrFilter = array("CREATED_BY"=>intval($USER->GetID()));
use Bitrix\Main\Context,
Bitrix\Currency\CurrencyManager,
Bitrix\Sale\Order,
Bitrix\Sale\Basket,
Bitrix\Sale\Delivery,
Bitrix\Sale\PaySystem;
global $USER;
Bitrix\Main\Loader::includeModule("sale");
Bitrix\Main\Loader::includeModule("catalog");
// Допустим некоторые поля приходит в запросе
$request = Context::getCurrent()->getRequest();
$productId = $request["PRODUCT_ID"];
$phone = $request["PHONE"];
$name = $request["NAME"];
$comment = $request["COMMENT"];
$siteId = Context::getCurrent()->getSite();
$currencyCode = CurrencyManager::getBaseCurrency();
// Создаёт новый заказ
$order = Order::create($siteId, $USER->isAuthorized() ? $USER->GetID() : 539);
$order->setPersonTypeId(1);
$order->setField('CURRENCY', $currencyCode);
if ($comment) {
$order->setField('USER_DESCRIPTION', $comment); // Устанавливаем поля комментария покупателя
}
// Создаём корзину с одним товаром
$basket = Basket::create($siteId);
$item = $basket->createItem('catalog', $productId);
$item->setFields(array(
'QUANTITY' => 1,
'CURRENCY' => $currencyCode,
'LID' => $siteId,
'PRODUCT_PROVIDER_CLASS' => '\CCatalogProductProvider',
));
$order->setBasket($basket);
// Создаём одну отгрузку и устанавливаем способ доставки - "Без доставки" (он служебный)
$shipmentCollection = $order->getShipmentCollection();
$shipment = $shipmentCollection->createItem();
$service = Delivery\Services\Manager::getById(Delivery\Services\EmptyDeliveryService::getEmptyDeliveryServiceId());
$shipment->setFields(array(
'DELIVERY_ID' => $service['ID'],
'DELIVERY_NAME' => $service['NAME'],
));
$shipmentItemCollection = $shipment->getShipmentItemCollection();
$shipmentItem = $shipmentItemCollection->createItem($item);
$shipmentItem->setQuantity($item->getQuantity());
// Создаём оплату со способом #1
$paymentCollection = $order->getPaymentCollection();
$payment = $paymentCollection->createItem();
$paySystemService = PaySystem\Manager::getObjectById(1);
$payment->setFields(array(
'PAY_SYSTEM_ID' => $paySystemService->getField("PAY_SYSTEM_ID"),
'PAY_SYSTEM_NAME' => $paySystemService->getField("NAME"),
));
// Устанавливаем свойства
$propertyCollection = $order->getPropertyCollection();
$phoneProp = $propertyCollection->getPhone();
$phoneProp->setValue($phone);
$nameProp = $propertyCollection->getPayerName();
$nameProp->setValue($name);
// Сохраняем
$order->doFinalAction(true);
$result = $order->save();
$orderId = $order->getId();