Hướng dẫn sử dụng curl tạo webhook sau đó cập nhật dữ liệu nó ghi ra file log (ok)

C:\xampp\htdocs\wordpress4\wp-content\themes\gutener\functions.php

add_filter( 'woocommerce_rest_check_permissions', 'my_woocommerce_rest_check_permissions', 90, 4 );
function my_woocommerce_rest_check_permissions( $permission, $context, $object_id, $post_type  ){
  return true;
}

C:\xampp\htdocs\wordpress4\woocommerce\request.log

{
	"id": 13,
	"name": "Testing",
	"slug": "testing",
	"permalink": "http:\/\/localhost\/wordpress4\/product\/testing\/",
	"date_created": "2022-04-19T06:54:01",
	"date_created_gmt": "2022-04-19T06:54:01",
	"date_modified": "2022-04-19T08:46:06",
	"date_modified_gmt": "2022-04-19T08:46:06",
	"type": "simple",
	"status": "publish",
	"featured": false,
	"catalog_visibility": "visible",
	"description": "<p>Testing c123<\/p>\n",
	"short_description": "",
	"sku": "",
	"price": "",
	"regular_price": "",
	"sale_price": "",
	"date_on_sale_from": null,
	"date_on_sale_from_gmt": null,
	"date_on_sale_to": null,
	"date_on_sale_to_gmt": null,
	"on_sale": false,
	"purchasable": false,
	"total_sales": 0,
	"virtual": false,
	"downloadable": false,
	"downloads": [],
	"download_limit": -1,
	"download_expiry": -1,
	"external_url": "",
	"button_text": "",
	"tax_status": "taxable",
	"tax_class": "",
	"manage_stock": false,
	"stock_quantity": null,
	"backorders": "no",
	"backorders_allowed": false,
	"backordered": false,
	"low_stock_amount": null,
	"sold_individually": false,
	"weight": "",
	"dimensions":
	{
		"length": "",
		"width": "",
		"height": ""
	},
	"shipping_required": true,
	"shipping_taxable": true,
	"shipping_class": "",
	"shipping_class_id": 0,
	"reviews_allowed": true,
	"average_rating": "0.00",
	"rating_count": 0,
	"upsell_ids": [],
	"cross_sell_ids": [],
	"parent_id": 0,
	"purchase_note": "",
	"categories": [
	{
		"id": 15,
		"name": "Uncategorized",
		"slug": "uncategorized"
	}],
	"tags": [],
	"images": [],
	"attributes": [],
	"default_attributes": [],
	"variations": [],
	"grouped_products": [],
	"menu_order": 0,
	"price_html": "",
	"related_ids": [],
	"meta_data": [],
	"stock_status": "instock",
	"has_options": false,
	"_links":
	{
		"self": [
		{
			"href": "http:\/\/localhost\/wordpress4\/wp-json\/wc\/v3\/products\/13"
		}],
		"collection": [
		{
			"href": "http:\/\/localhost\/wordpress4\/wp-json\/wc\/v3\/products"
		}]
	}
}

C:\xampp\htdocs\wordpress4\woocommerce\request.log

{
	"id": 13,
	"name": "Test",
	"slug": "testing",
	"permalink": "http:\/\/localhost\/wordpress4\/product\/testing\/",
	"date_created": "2022-04-19T06:54:01",
	"date_created_gmt": "2022-04-19T06:54:01",
	"date_modified": "2022-04-19T09:04:55",
	"date_modified_gmt": "2022-04-19T09:04:55",
	"type": "simple",
	"status": "publish",
	"featured": false,
	"catalog_visibility": "visible",
	"description": "<p>Test QA<\/p>\n",
	"short_description": "",
	"sku": "",
	"price": "",
	"regular_price": "",
	"sale_price": "",
	"date_on_sale_from": null,
	"date_on_sale_from_gmt": null,
	"date_on_sale_to": null,
	"date_on_sale_to_gmt": null,
	"on_sale": false,
	"purchasable": false,
	"total_sales": 0,
	"virtual": false,
	"downloadable": false,
	"downloads": [],
	"download_limit": -1,
	"download_expiry": -1,
	"external_url": "",
	"button_text": "",
	"tax_status": "taxable",
	"tax_class": "",
	"manage_stock": false,
	"stock_quantity": null,
	"backorders": "no",
	"backorders_allowed": false,
	"backordered": false,
	"low_stock_amount": null,
	"sold_individually": false,
	"weight": "",
	"dimensions":
	{
		"length": "",
		"width": "",
		"height": ""
	},
	"shipping_required": true,
	"shipping_taxable": true,
	"shipping_class": "",
	"shipping_class_id": 0,
	"reviews_allowed": true,
	"average_rating": "0.00",
	"rating_count": 0,
	"upsell_ids": [],
	"cross_sell_ids": [],
	"parent_id": 0,
	"purchase_note": "",
	"categories": [
	{
		"id": 15,
		"name": "Uncategorized",
		"slug": "uncategorized"
	}],
	"tags": [],
	"images": [],
	"attributes": [],
	"default_attributes": [],
	"variations": [],
	"grouped_products": [],
	"menu_order": 0,
	"price_html": "",
	"related_ids": [],
	"meta_data": [],
	"stock_status": "instock",
	"has_options": false,
	"_links":
	{
		"self": [
		{
			"href": "http:\/\/localhost\/wordpress4\/wp-json\/wc\/v3\/products\/13"
		}],
		"collection": [
		{
			"href": "http:\/\/localhost\/wordpress4\/wp-json\/wc\/v3\/products"
		}]
	}
}

Last updated