1b.app
Link copied -

Getting data from Wordpress on orders

If we receive orders via API, then:
1) you need to make the setting "Search for an article in meta_data" + a field where we specify the key with the article from the key field, and take the value from value.
Here is an example of how it looks like in api - now we just take it with sku, as far as I understand.
Here is the order https://cabinet.b2bframes.com/admin/customorder/order/42882/edit/
Here is the request https://ebay.ossaframes.com/wp-json/wc/v3/orders/45015
2) Make a setting to get data from meta_data
Request example https://ossaframes.com/wp-json/wc/v3/orders/122502
You need to take data from the same array as in paragraph 1 - I think that it can be combined into one revision if you make it possible to write the field from the array to the article) and check the box (search for a match based on this field )
You need to make the same table as we did for the database
- You need to specify the field in which to wr
Original question is available on version: ru

Answers:


If we receive orders via API, then:

We don't get orders via API - we get them from the database :)

1) you need to make the setting "Search for an article in meta_data" + a field where we specify the key with the article from the key field, and take the value from value.
Here is an example of how it looks in api - now we just take it with sku, as far as I understand.
Here is the order https://cabinet.b2bframes.com/admin/customorder/order/42882/edit/
Here is the request https://ebay.ossaframes.com/wp-json/wc/v3/orders/45015

As I understand it, this is the post_meta table in the database, and we take a record with the _sku key there
Make a setting by which you can set your key for an entry in this table - 1h

2) Make a setting to get data from meta_data
Request example https://ossaframes.com/wp-json/wc/v3/orders/122502
You need to take data from the same array as in paragraph 1 - I think that it can be combined into one revision if you make it possible to write the field from the array to the article) and check the box (search for a match based on this field)
You need to make the same table as we did for the database
- You need to specify the field in which to write (process product (you need the ability to write in additional fields + standard fields (process product) or process (the same fields as for the database))
- You need to specify from which key to take value
- Need the ability to specify which array to take the value from: Order (general array https://take.ms/jElUi ) or product https://take.ms/N2rGNg

In the import action, there is a process block for importing from postmeta.
Make it possible to write to the fields / additional fields of the process product and refactor the action - 4h
PS: I recommend checking the structure of the WordPress database to see if everything agrees with the discussion
29.09.2021, 15:26
Original comment available on version: ru

Суханіцький Андрій OneBox CORP
OneBox Corp - Інтегратор
Personal license

Tyndyk Maxim Vadimovich
OneBox production
Administrator wrote:
PS: I recommend checking the structure of the WordPress database to see if everything agrees with the discussion

The problem here is that it does not converge at all, this data is in the world, and it will not work to pull it with the settings that are. I'll check again, but I looked before and they were not there (
29.09.2021, 15:33
Original comment available on version: ru


The problem here is that it does not converge at all, this data is in the world, and it will not work to pull it with the settings that are. I'll check again, but I looked before and they were not there (

Well, duck write where they are stored there - we'll think about what to do with it)
29.09.2021, 15:53
Original comment available on version: ru

Суханіцький Андрій OneBox CORP
OneBox Corp - Інтегратор
Personal license

Tyndyk Maxim Vadimovich
OneBox production
Administrator wrote:

The problem here is that it does not converge at all, this data is in the world, and it will not work to pull it with the settings that are. I'll check again, but I looked before and they were not there (

Well, duck write where they are stored there - we'll think about what to do with it)

ok, I'll try to figure it out
29.09.2021, 16:04
Original comment available on version: ru

Суханіцький Андрій OneBox CORP
OneBox Corp - Інтегратор
Personal license
Yes, found
The data is in the table wpossa_woocommerce_order_itemmeta
On the example of an order https://cabinet.b2bframes.com/admin/customorder/order/43111/edit/
1) First, look for the product id order_item_id in the wpossa_woocommerce_order_items table:
SELECT * FROM `wpossa_woocommerce_order_items` WHERE `order_id` = 125594
- We need item with order_item_type=line_item
- get it order_item_id=104
2) Next, we are looking for fields in the wpossa_woocommerce_order_itemmeta table:
SELECT * FROM `wpossa_woocommerce_order_itemmeta` WHERE `order_item_id` = 104 ORDER BY `meta_id` DESC
- now we need to select the meta_key values that we will receive
- and take the value of the meta_value field, then you need to specify where to write it in the box
So, given that all this information is in the table with the goods, it is logical to write this in the goods fields.
07.10.2021, 18:43
Original comment available on version: ru


Yes, found
The data is in the table wpossa_woocommerce_order_itemmeta
On the example of an order https://cabinet.b2bframes.com/admin/customorder/order/43111/edit/
1) First, look for the product id order_item_id in the wpossa_woocommerce_order_items table:
SELECT * FROM `wpossa_woocommerce_order_items` WHERE `order_id` = 125594
- We need an item with order_item_type=line_item
- get it order_item_id=104
2) Next, we are looking for fields in the wpossa_woocommerce_order_itemmeta table:
SELECT * FROM `wpossa_woocommerce_order_itemmeta` WHERE `order_item_id` = 104 ORDER BY `meta_id` DESC
- now we need to select the meta_key values that we will receive
- and take the value of the meta_value field, then you need to specify where to write it in the box
So, given that all this information is in the table with the goods, it is logical to write this in the goods fields.

if this is relative to clause 1 upon receipt of the article, then for an estimate of 1 hour, you can make a setting from which key of this table to receive the value
but if this is not a variation, then it already takes the value from this table by the _product_id key and searches for the product according to the search selection in the setting
08.10.2021, 16:58
Original comment available on version: ru

Суханіцький Андрій OneBox CORP
OneBox Corp - Інтегратор
Personal license

Tyndyk Maxim Vadimovich
OneBox production
Administrator wrote:
if this is relative to clause 1 upon receipt of the article, then for an estimate of 1 hour, you can make a setting from which key of this table to receive the value
but if this is not a variation, then it already takes the value from this table by the _product_id key and searches for the product according to the search selection in the setting

For one site we need to look for how it works now
And for the second you need to search, as I described
The option fits.
On the screenshot, how it looks like
08.10.2021, 17:53
Original comment available on version: ru

Суханіцький Андрій OneBox CORP
OneBox Corp - Інтегратор
Personal license

Sukhanitsky Andrey
Integrator
Integrator CRM wrote:
2) Make a setting to get data from meta_data
Request example https://ossaframes.com/wp-json/wc/v3/orders/122502
You need to take data from the same array as in paragraph 1 - I think that it can be combined into one revision if you make it possible to write the field from the array to the article) and check the box (search for a match based on this field)
You need to make the same table as we did for the database
- You need to specify the field in which to write (process product (you need the ability to write in additional fields + standard fields (process product) or process (the same fields as for the database))
- You need to specify from which key to take value
- Need the ability to specify which array to take the value from: Order (general array https://take.ms/jElUi ) or product https://take.ms/N2rGNg

What about this setting?
This is necessary according to the same logic, only write in the additional field of either the product or the process.
The bottom line is that we will have only 1 product in such an order, here I can write in the process fields, but it is better to foresee and write in the additional process product field in order to be able to write correctly
08.10.2021, 17:55
Original comment available on version: ru

Суханіцький Андрій OneBox CORP
OneBox Corp - Інтегратор
Personal license
Will you rate?
15.10.2021, 13:20
Original comment available on version: ru


Will you rate?

probably higher as soon as you wrote this item - I gave an assessment.

In the import action, there is a process block for importing from postmeta.
Make it possible to write to the fields / additional fields of the process product and refactor the action - 4h

or is something missing?
20.10.2021, 15:28
Original comment available on version: ru

Суханіцький Андрій OneBox CORP
OneBox Corp - Інтегратор
Personal license
ahh
sorry I didn't see it right away
20.10.2021, 15:31
Original comment available on version: ru

Please join the conversation. If you have something to say - please write a comment. You will need a mobile phone and an SMS code for identification to enter. Log in and comment