K
K
Khabib Omarov2020-01-31 17:49:42
Bitrix24
Khabib Omarov, 2020-01-31 17:49:42

How to get order data in Woocommerce cart?

I connect an online store on WooCommerce with Bitrix24 CRM via webhooks. It is necessary that when placing an order in Bitrix, a lead is created with the data in the basket.
The request was accepted, it remains only to receive the order data. How to get the order number, first name, last name, and the amount of goods in the basket?

The received data must be recorded here

$queryData = http_build_query(array(
    'fields' => array(
    'TITLE' => "Заказ с сайта №",
    'NAME' => [$billing_first_name],
    ),
    'params' => array("REGISTER_SONET_EVENT" => "Y")
  ));

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
WP Panda, 2020-01-31
@temp-market

The cart object and the order object are different objects, at what point do you want to send data to Bitrix?

Y
Yuri Paimurzin, 2020-02-01
@rusellsystems

as an option, use the woocommerce rest api and processing orders by krone on the server / hosting under certain conditions (for example, status), processed orders can change the status after sending to B24.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question