{"id":480494,"date":"2026-05-21T08:48:14","date_gmt":"2026-05-21T08:48:14","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=480494"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=480494","title":{"rendered":"\u041a\u0430\u043a \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043f\u043b\u0430\u0433\u0438\u043d \u0434\u043b\u044f WooCommerce \u043f\u043e\u0434 Yandex YCP \u0438\u043b\u0438 \u043a\u0430\u043a \u043a\u0443\u043f\u0438\u0442\u044c \u0432 1 \u043a\u043b\u0438\u043a \u0438\u0437 \u0410\u043b\u0438\u0441\u044b"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h3>\u0420\u0430\u0437\u0431\u0438\u0440\u0430\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430 \u043d\u0430 WordPress + WooCommerce \u0441 YCP \u2014 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u043c \u042f\u043d\u0434\u0435\u043a\u0441\u0430 \u0434\u043b\u044f \u043f\u043e\u043a\u0443\u043f\u043e\u043a \u0447\u0435\u0440\u0435\u0437 \u0410\u043b\u0438\u0441\u0443 AI, \u041f\u043e\u0438\u0441\u043a \u0438 \u0420\u0438\u0442\u043c<\/h3>\n<p>\u0412 \u043a\u043e\u043d\u0446\u0435 \u043c\u0430\u044f 2026 \u042f\u043d\u0434\u0435\u043a\u0441 \u043e\u0442\u043a\u0440\u044b\u043b <a href=\"https:\/\/merchants.yandex.ru\/ycp\" rel=\"noopener noreferrer nofollow\">Yandex Commerce Protocol<\/a> \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u2014 \u0442\u0435\u043f\u0435\u0440\u044c \u043b\u044e\u0431\u043e\u0439 \u043e\u043d\u043b\u0430\u0439\u043d-\u043c\u0430\u0433\u0430\u0437\u0438\u043d \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u0440\u043e\u0434\u0430\u0436\u0438 \u0447\u0435\u0440\u0435\u0437 \u0410\u043b\u0438\u0441\u0443 AI, \u041f\u043e\u0438\u0441\u043a \u0438 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043b\u0435\u043d\u0442\u0443 \u0420\u0438\u0442\u043c. \u0418\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0435\u0441\u0442\u044c \u0434\u043b\u044f \u042f\u043d\u0434\u0435\u043a\u0441 KIT, \u042f\u043d\u0434\u0435\u043a\u0441 \u041c\u0430\u0440\u043a\u0435\u0442\u0430 \u0438 1\u0421-\u0411\u0438\u0442\u0440\u0438\u043a\u0441. \u0414\u043b\u044f \u0432\u0441\u0435\u0433\u043e \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u2014 API.<\/p>\n<p>\u0423 \u043c\u0435\u043d\u044f \u043c\u0430\u0433\u0430\u0437\u0438\u043d \u043d\u0430 WooCommerce, \u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u00ab\u043d\u0430\u0436\u0430\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443 \u0438 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e\u00bb \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u043d\u0435 \u0431\u044b\u043b\u043e. \u042f \u043c\u043e\u0433 \u043b\u0438\u0431\u043e \u0436\u0434\u0430\u0442\u044c, \u043f\u043e\u043a\u0430 \u042f\u043d\u0434\u0435\u043a\u0441 \u0438\u043b\u0438 \u043a\u0442\u043e-\u0442\u043e \u0435\u0449\u0451 \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u0434\u043b\u044f WordPress (\u0441 \u043d\u0435\u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u044b\u043c ETA), \u043b\u0438\u0431\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441 API \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d \u0441\u0430\u043c. \u0412\u044b\u0431\u0440\u0430\u043b \u0432\u0442\u043e\u0440\u043e\u0435. \u041d\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0443\u0448\u043b\u043e \u043e\u043a\u043e\u043b\u043e \u0434\u0432\u0443\u0445 \u043d\u0435\u0434\u0435\u043b\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e \u0432\u0435\u0447\u0435\u0440\u0430\u043c, \u043f\u043b\u044e\u0441 \u0435\u0449\u0451 \u043d\u0435\u0434\u0435\u043b\u044f \u043d\u0430 \u043e\u0442\u043b\u0430\u0434\u043a\u0443 \u0441 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u043c \u043a\u0430\u0431\u0438\u043d\u0435\u0442\u043e\u043c \u042f\u043d\u0434\u0435\u043a\u0441\u0430. \u041f\u043e \u0438\u0442\u043e\u0433\u0443 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f open-source \u043f\u043b\u0430\u0433\u0438\u043d \u043d\u0430 GPL-2.0, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0437\u0430\u043a\u0440\u044b\u0442\u044b \u0432\u0441\u0435 10 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u043e\u0432 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 YCP v1: <a href=\"https:\/\/github.com\/perfinn\/YCP-Yandex-Commerce-Woocommerce\" rel=\"noopener noreferrer nofollow\">github.com\/perfinn\/YCP-Yandex-Commerce-Woocommerce<\/a>.<\/p>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0443 \u043d\u0435 \u00ab\u043a\u0430\u043a \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c\u00bb (\u044d\u0442\u043e \u0432 README), \u0430 <strong>\u043a\u0430\u043a \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f<\/strong>: \u043a\u0430\u043a\u0438\u0435 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u044b \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c, \u043a\u0430\u043a \u043c\u0430\u043f\u043f\u0438\u0442\u044c \u0437\u0430\u043a\u0430\u0437\u044b \u0438\u0437 \u042f\u043d\u0434\u0435\u043a\u0441\u0430 \u0432 WC, \u0433\u0434\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u043d\u0430 \u0433\u0440\u0430\u0431\u043b\u0438 (\u0441\u0442\u0430\u0442\u0443\u0441\u044b \u0437\u0430\u043a\u0430\u0437\u043e\u0432, \u043f\u0438\u0441\u044c\u043c\u0430, HPOS-\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c), \u0438 \u043f\u043e\u0447\u0435\u043c\u0443 \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0438\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u044c \u043f\u043e session_id \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u043d\u0430\u0447\u0430\u043b\u0430. \u041c\u043e\u0436\u0435\u0442, \u043a\u043e\u043c\u0443-\u0442\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043b\u0438\u0431\u043e \u0432\u0437\u044f\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d \u043f\u043e\u0434 \u0441\u0432\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u043b\u0438\u0431\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0430\u043d\u0430\u043b\u043e\u0433 \u043f\u043e\u0434 \u0434\u0440\u0443\u0433\u0443\u044e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443.<\/p>\n<hr\/>\n<h3>\u0427\u0442\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u0434\u0435\u043b\u0430\u0435\u0442 YCP \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b<\/h3>\n<p>\u0427\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u043c\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u2014 \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0431\u0437\u043e\u0440 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430.<\/p>\n<p>YCP \u2014 \u044d\u0442\u043e HTTPS REST API \u043e\u0442 \u042f\u043d\u0434\u0435\u043a\u0441\u0430 \u043a <strong>\u0432\u0430\u0448\u0435\u043c\u0443 \u0441\u0430\u0439\u0442\u0443<\/strong>. \u041d\u0435 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442. \u0422\u043e \u0435\u0441\u0442\u044c \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043a\u0443\u043f\u0430\u0442\u0435\u043b\u044c \u0432 \u0410\u043b\u0438\u0441\u0435 \u0438\u043b\u0438 \u041f\u043e\u0438\u0441\u043a\u0435 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u0442 \u00ab\u041a\u0443\u043f\u0438\u0442\u044c \u0432 1 \u043a\u043b\u0438\u043a\u00bb, \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043b\u0435\u0442\u044f\u0442 \u043e\u0442 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u042f\u043d\u0434\u0435\u043a\u0441\u0430 \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430. \u041c\u0430\u0433\u0430\u0437\u0438\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0430\u0431\u043e\u0440 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u043e\u0432, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u042f\u043d\u0434\u0435\u043a\u0441 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0442\u043e\u0432\u0430\u0440\u0430\u0445, \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0443, \u043e\u0444\u043e\u0440\u043c\u043b\u044f\u0435\u0442 \u0437\u0430\u043a\u0430\u0437 \u0438 \u043f\u043e\u0442\u043e\u043c \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0435\u0433\u043e \u0441\u0442\u0430\u0442\u0443\u0441.<\/p>\n<p>\u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043c\u0430\u0440\u043a\u0435\u0442\u043f\u043b\u0435\u0439\u0441-\u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0439 (\u0433\u0434\u0435 \u043c\u0430\u0433\u0430\u0437\u0438\u043d \u0432\u044b\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0444\u0438\u0434 \u0438 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u0442), \u0442\u0443\u0442 \u0434\u0432\u0443\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0439 live-\u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b. \u041a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u0438\u0434\u0438\u0442 \u0442\u043e\u0432\u0430\u0440 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u0445 \u0410\u043b\u0438\u0441\u044b \u2014 \u042f\u043d\u0434\u0435\u043a\u0441 \u0434\u0435\u043b\u0430\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043a \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0443 \u00ab\u0443\u0442\u043e\u0447\u043d\u0438 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u0446\u0435\u043d\u0443 \u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0435\u00bb. \u041a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u0447\u0442\u043e-\u0442\u043e \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u043e \u0441\u0442\u0430\u0442\u0443\u0441\u043e\u043c \u0437\u0430\u043a\u0430\u0437\u0430 \u2014 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u0447\u0435\u0440\u0435\u0437 API.<\/p>\n<p>\u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043f\u043b\u0430\u0433\u0438\u043d \u0434\u043e\u043b\u0436\u0435\u043d <strong>\u0434\u0435\u0440\u0436\u0430\u0442\u044c REST API \u0432\u0441\u0435\u0433\u0434\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c, \u0431\u044b\u0441\u0442\u0440\u044b\u043c \u0438 \u0438\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u044b\u043c<\/strong>. \u0418 \u0442\u0443\u0442 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435.<\/p>\n<hr\/>\n<h3>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u043b\u0430\u0433\u0438\u043d\u0430<\/h3>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u044b, \u043f\u043e\u043a\u0430\u0436\u0443 \u043e\u0431\u0449\u0438\u0439 \u0441\u043a\u0435\u043b\u0435\u0442. WordPress-\u043f\u043b\u0430\u0433\u0438\u043d \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u043f\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0441\u0445\u0435\u043c\u0435: \u0433\u043b\u0430\u0432\u043d\u044b\u0439 PHP-\u0444\u0430\u0439\u043b \u0441 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u043c \u043f\u043b\u0430\u0433\u0438\u043d\u0430, \u043a\u043b\u0430\u0441\u0441\u044b \u043f\u043e\u0434 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438, action\/filter \u0445\u0443\u043a\u0438 \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0441 WP \u0438 WooCommerce.<\/p>\n<pre><code>yandex-ycp-woo\/\u251c\u2500\u2500 yandex-ycp-woo.php       # \u0413\u043b\u0430\u0432\u043d\u044b\u0439 \u0444\u0430\u0439\u043b, \u0445\u0443\u043a\u0438 \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438, \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f\u251c\u2500\u2500 includes\/\u2502   \u251c\u2500\u2500 class-ycp-rest.php       # \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f REST API \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u043e\u0432\u2502   \u251c\u2500\u2500 class-ycp-auth.php       # Bearer-\u0442\u043e\u043a\u0435\u043d \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f\u2502   \u251c\u2500\u2500 class-ycp-checkout.php   # \u041b\u043e\u0433\u0438\u043a\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0437\u0430\u043a\u0430\u0437\u0430 \u0438\u0437 \u042f\u043d\u0434\u0435\u043a\u0441\u0430\u2502   \u251c\u2500\u2500 class-ycp-delivery.php   # \u0412\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438 (\u0421\u0414\u042d\u041a, \u041f\u0412\u0417)\u2502   \u251c\u2500\u2500 class-ycp-orders.php     # \u041c\u0430\u043f\u043f\u0438\u043d\u0433 \u0442\u043e\u0432\u0430\u0440\u043e\u0432, \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u0443\u0441\u043e\u0432\u2502   \u251c\u2500\u2500 class-ycp-logger.php     # \u041b\u043e\u0433 \u0432 WP option (\u0434\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438)\u2502   \u2514\u2500\u2500 class-ycp-admin.php      # \u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0432 \u0430\u0434\u043c\u0438\u043d\u043a\u0435\u251c\u2500\u2500 assets\/\u2502   \u2514\u2500\u2500 admin.css\u2514\u2500\u2500 readme.txt                   # \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442 WordPress.org<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:87px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u043e\u0432 \u0438\u0434\u0451\u0442 \u0447\u0435\u0440\u0435\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0434\u043b\u044f WP \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c <code>register_rest_route<\/code> \u0432 action <code>rest_api_init<\/code>:<\/p>\n<pre><code class=\"php\">add_action( 'rest_api_init', function() {    $namespace = 'ycp\/v1';     \/\/ GET \/ycp\/v1\/warehouses    register_rest_route( $namespace, '\/warehouses', [        'methods'             =&gt; 'GET',        'callback'            =&gt; [ 'YCP_Rest', 'get_warehouses' ],        'permission_callback' =&gt; [ 'YCP_Auth', 'check_bearer' ],    ]);     \/\/ POST \/ycp\/v1\/checkout    register_rest_route( $namespace, '\/checkout', [        'methods'             =&gt; 'POST',        'callback'            =&gt; [ 'YCP_Rest', 'create_checkout' ],        'permission_callback' =&gt; [ 'YCP_Auth', 'check_bearer' ],    ]);     \/\/ ... \u0435\u0449\u0451 8 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u043e\u0432});<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0432\u0430\u0436\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441 <code>permission_callback<\/code>. \u042d\u0442\u043e \u043d\u0435 \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u0448\u0442\u0443\u043a\u0430, \u044d\u0442\u043e <strong>\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 WP REST API<\/strong>. \u0415\u0441\u043b\u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0442\u0443\u0434\u0430 <code>__return_true<\/code>, WordPress \u0431\u0443\u0434\u0435\u0442 \u0440\u0443\u0433\u0430\u0442\u044c\u0441\u044f, \u0438 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442 \u0441\u0442\u0430\u043d\u0435\u0442 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c \u0431\u0435\u0437 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438. \u0427\u0442\u043e \u0434\u043b\u044f \u043f\u043b\u0430\u0442\u0451\u0436\u043d\u043e\u0433\u043e API \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e.<\/p>\n<p>\u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0432 YCP \u0438\u0434\u0451\u0442 \u043f\u043e Bearer-\u0442\u043e\u043a\u0435\u043d\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u042f\u043d\u0434\u0435\u043a\u0441 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0432 \u043a\u0430\u0431\u0438\u043d\u0435\u0442\u0435 \u0438 \u043f\u0440\u0438\u0441\u044b\u043b\u0430\u0435\u0442 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435:<\/p>\n<pre><code class=\"php\">class YCP_Auth {    public static function check_bearer( WP_REST_Request $request ) {        $stored_token = get_option( 'ycpy_bearer_token' );        if ( empty( $stored_token ) ) {            return new WP_Error( 'no_token_configured', 'Token not set', [ 'status' =&gt; 503 ] );        }         \/\/ \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u2014 Authorization: Bearer ...        $auth = $request-&gt;get_header( 'authorization' );        if ( $auth &amp;&amp; stripos( $auth, 'Bearer ' ) === 0 ) {            $token = trim( substr( $auth, 7 ) );            if ( hash_equals( $stored_token, $token ) ) {                return true;            }        }         \/\/ Fallback \u043d\u0430 X-API-Key \u2014 \u0438\u043d\u043e\u0433\u0434\u0430 \u0442\u0430\u043a \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 curl        $api_key = $request-&gt;get_header( 'x_api_key' );        if ( $api_key &amp;&amp; hash_equals( $stored_token, $api_key ) ) {            return true;        }         return new WP_Error( 'unauthorized', 'Invalid token', [ 'status' =&gt; 401 ] );    }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <code>hash_equals<\/code> \u0432\u043c\u0435\u0441\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e <code>===<\/code> \u2014 \u044d\u0442\u043e \u0437\u0430\u0449\u0438\u0442\u0430 \u043e\u0442 timing attacks. \u0414\u043b\u044f \u043f\u043b\u0430\u0442\u0451\u0436\u043d\u043e\u0433\u043e API \u0442\u0430\u043a\u0430\u044f \u043c\u0435\u043b\u043e\u0447\u044c \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u0430, \u0438 WordPress-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0447\u0430\u0441\u0442\u043e \u0435\u0451 \u0437\u0430\u0431\u044b\u0432\u0430\u044e\u0442.<\/p>\n<hr\/>\n<h3>\u042d\u043d\u0434\u043f\u043e\u0438\u043d\u0442 1: warehouses<\/h3>\n<p>\u0421\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439. \u042f\u043d\u0434\u0435\u043a\u0441 \u043f\u0440\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0430\u0448\u0438\u0445 \u0441\u043a\u043b\u0430\u0434\u043e\u0432. \u0418\u0437 \u0430\u0434\u043c\u0438\u043d\u043a\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u044f \u0434\u0430\u044e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u043a\u043b\u0430\u0434 \u2014 \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u043c\u0435\u043b\u043a\u0438\u0445 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u043e\u0432 \u043d\u0430 WooCommerce \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e.<\/p>\n<pre><code class=\"php\">public static function get_warehouses( WP_REST_Request $request ) {    $warehouse = [        'id'      =&gt; 'main',        'name'    =&gt; get_option( 'ycpy_warehouse_name', '\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u043a\u043b\u0430\u0434' ),        'address' =&gt; [            'country'  =&gt; 'RU',            'city'     =&gt; get_option( 'ycpy_warehouse_city' ),            'street'   =&gt; get_option( 'ycpy_warehouse_street' ),            'building' =&gt; get_option( 'ycpy_warehouse_building' ),        ],        'phone'   =&gt; get_option( 'ycpy_warehouse_phone' ),    ];     return rest_ensure_response([        'warehouses' =&gt; [ $warehouse ],    ]);}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0422\u0443\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e, \u043d\u043e \u043e\u0431\u0440\u0430\u0449\u0443 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 <code>rest_ensure_response()<\/code> \u2014 \u044d\u0442\u043e WP-\u043e\u0431\u0451\u0440\u0442\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u043e\u0442\u0432\u0435\u0442\u0430 \u0441 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430\u043c\u0438. \u0411\u0435\u0437 \u043d\u0435\u0451 \u043c\u043e\u0436\u0435\u0442 \u0443\u043b\u0435\u0442\u0435\u0442\u044c \u0433\u043e\u043b\u044b\u0439 array, \u0438 \u042f\u043d\u0434\u0435\u043a\u0441 \u043d\u0435 \u0440\u0430\u0441\u043f\u0430\u0440\u0441\u0438\u0442.<\/p>\n<hr\/>\n<h3>\u042d\u043d\u0434\u043f\u043e\u0438\u043d\u0442 2: basket\/check \u2014 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043a\u043e\u0440\u0437\u0438\u043d\u044b<\/h3>\n<p>\u0412\u043e\u0442 \u044d\u0442\u043e \u0443\u0436\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e. \u041a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u043c\u043e\u0442\u0440\u0438\u0442 \u0442\u043e\u0432\u0430\u0440 \u0432 \u0410\u043b\u0438\u0441\u0435 \u0438 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u0442 \u00ab\u041a\u0443\u043f\u0438\u0442\u044c\u00bb, \u042f\u043d\u0434\u0435\u043a\u0441 \u043f\u0435\u0440\u0435\u0434 \u043f\u043e\u043a\u0430\u0437\u043e\u043c \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0447\u0435\u043a\u0430\u0443\u0442\u0430 \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u043c\u0430\u0433\u0430\u0437\u0438\u043d: \u00ab\u0443 \u043d\u0430\u0441 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0435 \u0432\u043e\u0442 \u044d\u0442\u0438 \u0442\u043e\u0432\u0430\u0440\u044b \u2014 \u043e\u043d\u0438 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435, \u0446\u0435\u043d\u044b \u0442\u0435 \u0436\u0435, \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0435\u0441\u0442\u044c, \u0433\u0430\u0431\u0430\u0440\u0438\u0442\u044b \u0434\u043b\u044f \u0440\u0430\u0441\u0447\u0451\u0442\u0430 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438 \u043a\u0430\u043a\u0438\u0435?\u00bb.<\/p>\n<pre><code class=\"php\">public static function basket_check( WP_REST_Request $request ) {    $body  = $request-&gt;get_json_params();    $items = $body['items'] ?? [];     $checked_items = [];    $unavailable   = [];     foreach ( $items as $item ) {        $product = self::find_product( $item['id'] );         if ( ! $product || ! $product-&gt;is_in_stock() ) {            $unavailable[] = [ 'id' =&gt; $item['id'], 'reason' =&gt; 'out_of_stock' ];            continue;        }         $checked_items[] = [            'id'         =&gt; $item['id'],            'price'      =&gt; self::format_money( $product-&gt;get_price() ),            'currency'   =&gt; 'RUB',            'quantity'   =&gt; $item['quantity'],            'available'  =&gt; $product-&gt;get_stock_quantity() ?? 999,            'dimensions' =&gt; self::get_product_dimensions( $product ),        ];    }     return rest_ensure_response([        'items'       =&gt; $checked_items,        'unavailable' =&gt; $unavailable,    ]);}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041c\u0430\u043f\u043f\u0438\u043d\u0433 \u0442\u043e\u0432\u0430\u0440\u043e\u0432 \u2014 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u044f. \u042f\u043d\u0434\u0435\u043a\u0441 \u043f\u0440\u0438\u0441\u044b\u043b\u0430\u0435\u0442 <code>id<\/code> \u0442\u043e\u0432\u0430\u0440\u0430, \u0438 \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u044d\u0442\u043e: SKU \u0432 WC \u0438\u043b\u0438 \u0447\u0438\u0441\u043b\u043e\u0432\u043e\u0439 post_id WooCommerce-\u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430. \u042f \u0441\u0434\u0435\u043b\u0430\u043b \u0434\u0432\u043e\u0439\u043d\u043e\u0439 \u043f\u043e\u0438\u0441\u043a:<\/p>\n<pre><code class=\"php\">private static function find_product( $id ) {    \/\/ 1. \u041f\u0440\u043e\u0431\u0443\u0435\u043c \u043a\u0430\u043a SKU (\u0430\u0440\u0442\u0438\u043a\u0443\u043b)    $product_id = wc_get_product_id_by_sku( $id );    if ( $product_id ) {        return wc_get_product( $product_id );    }     \/\/ 2. \u0415\u0441\u043b\u0438 ID \u0447\u0438\u0441\u043b\u043e\u0432\u043e\u0439 \u2014 \u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043a\u0430\u043a post_id    if ( is_numeric( $id ) ) {        $product = wc_get_product( (int) $id );        if ( $product &amp;&amp; $product-&gt;exists() ) {            return $product;        }    }     return null;}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u042d\u0442\u043e \u0433\u0438\u0431\u043a\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u2014 \u043c\u0435\u0440\u0447\u0430\u043d\u0442 \u043c\u043e\u0436\u0435\u0442 \u0432 \u0444\u0438\u0434\u0435 \u042f\u043d\u0434\u0435\u043a\u0441\u0430 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0447\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u0435\u0435: SKU \u0438\u043b\u0438 \u0447\u0438\u0441\u043b\u043e\u0432\u043e\u0439 ID WC-\u0442\u043e\u0432\u0430\u0440\u0430. \u0413\u043b\u0430\u0432\u043d\u043e\u0435, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438 \u043c\u0430\u043f\u043f\u0438\u043d\u0433\u0435 \u0432 \u043e\u0431\u0440\u0430\u0442\u043d\u0443\u044e \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u0432\u0441\u0451 \u043d\u0430\u0448\u043b\u043e\u0441\u044c.<\/p>\n<p>\u0421 \u0433\u0430\u0431\u0430\u0440\u0438\u0442\u0430\u043c\u0438 \u0442\u043e\u0436\u0435 \u0435\u0441\u0442\u044c \u043d\u044e\u0430\u043d\u0441. WooCommerce \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u0434\u0430\u0451\u0442 \u043f\u043e\u043b\u044f weight, length, width, height \u2014 \u043d\u043e \u043c\u043d\u043e\u0433\u0438\u0435 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u044b \u0438\u0445 \u043d\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u044e\u0442. \u0410 \u0431\u0435\u0437 \u0433\u0430\u0431\u0430\u0440\u0438\u0442\u043e\u0432 \u042f\u043d\u0434\u0435\u043a\u0441 \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438 \u0421\u0414\u042d\u041a, \u0438 \u0437\u0430\u043a\u0430\u0437 \u043d\u0435 \u043e\u0444\u043e\u0440\u043c\u0438\u0442\u0441\u044f. \u042f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0442\u043e\u0432\u0430\u0440\u043e\u0432 \u0431\u0435\u0437 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432:<\/p>\n<pre><code class=\"php\">private static function get_product_dimensions( $product ) {    $weight = $product-&gt;get_weight() ?: get_option( 'ycpy_default_weight', 0.5 );    $length = $product-&gt;get_length() ?: get_option( 'ycpy_default_length', 15 );    $width  = $product-&gt;get_width()  ?: get_option( 'ycpy_default_width', 10 );    $height = $product-&gt;get_height() ?: get_option( 'ycpy_default_height', 5 );     return [        'weight' =&gt; (float) $weight,        'length' =&gt; (float) $length,        'width'  =&gt; (float) $width,        'height' =&gt; (float) $height,    ];}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0414\u0435\u0444\u043e\u043b\u0442\u044b \u0437\u0430\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u0430\u0434\u043c\u0438\u043d\u043a\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u2014 \u044d\u0442\u043e \u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0438\u0441\u0441 \u043c\u0435\u0436\u0434\u0443 \u00ab\u043c\u0430\u0433\u0430\u0437\u0438\u043d \u043e\u0431\u044f\u0437\u0430\u043d \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u0432\u0441\u0435\u0445 \u0442\u043e\u0432\u0430\u0440\u043e\u0432\u00bb \u0438 \u00ab\u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0447\u0442\u043e-\u0442\u043e \u043e\u0442\u0434\u0430\u0434\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043a\u0430\u0437 \u0445\u043e\u0442\u044f \u0431\u044b \u043f\u0440\u043e\u0448\u0451\u043b\u00bb. \u042f \u0432\u044b\u0431\u0438\u0440\u0430\u044e \u00ab\u043b\u0443\u0447\u0448\u0435 \u043e\u0442\u0434\u0430\u0442\u044c \u0434\u0435\u0444\u043e\u043b\u0442 \u0438 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0434\u0438\u0442\u044c \u043c\u0435\u0440\u0447\u0430\u043d\u0442\u0430\u00bb, \u0447\u0435\u043c \u00ab\u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u043f\u043e\u043a\u0443\u043f\u043a\u0435\u00bb.<\/p>\n<hr\/>\n<h3>\u042d\u043d\u0434\u043f\u043e\u0438\u043d\u0442 3: checkout \u2014 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0437\u0430\u043a\u0430\u0437\u0430<\/h3>\n<p>\u0421\u0430\u043c\u044b\u0439 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442. \u042d\u0442\u043e \u043a\u043e\u0433\u0434\u0430 \u042f\u043d\u0434\u0435\u043a\u0441 \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u0445\u043e\u0447\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0443 \u043d\u0430\u0441 \u0432 WC \u043d\u043e\u0432\u044b\u0439 \u0437\u0430\u043a\u0430\u0437. \u0418 \u0442\u0443\u0442 \u0441\u0430\u043c\u0430\u044f \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u043b\u043e\u0432\u0443\u0448\u043a\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u043d\u0430\u0441\u0442\u0443\u043f\u0438\u043b \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438.<\/p>\n<p><strong>\u041b\u043e\u0432\u0443\u0448\u043a\u0430 1: \u043f\u0438\u0441\u044c\u043c\u0430 \u00ab\u041d\u043e\u0432\u044b\u0439 \u0437\u0430\u043a\u0430\u0437 \u043d\u0430 0 \u20bd\u00bb.<\/strong><\/p>\n<p>\u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0437\u0430\u043a\u0430\u0437 \u0432 WC \u0447\u0435\u0440\u0435\u0437 <code>wc_create_order()<\/code> \u0441\u043e \u0441\u0442\u0430\u0442\u0443\u0441\u043e\u043c <code>pending<\/code>, WooCommerce \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0445\u0443\u043a\u0438 order-created \u0438 \u0448\u043b\u0451\u0442 \u043f\u0438\u0441\u044c\u043c\u043e \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0443 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430 \u00ab\u041d\u043e\u0432\u044b\u0439 \u0437\u0430\u043a\u0430\u0437 #1234 \u043d\u0430 \u0441\u0443\u043c\u043c\u0443 0 \u20bd\u00bb. \u041f\u043e\u0447\u0435\u043c\u0443 0? \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u042f\u043d\u0434\u0435\u043a\u0441 \u0435\u0449\u0451 \u043d\u0435 \u043f\u0440\u0438\u0441\u043b\u0430\u043b \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0443\u043c\u043c\u0443 \u2014 \u043e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430 \u043f\u043e\u0437\u0436\u0435, \u043f\u043e\u0441\u043b\u0435 \u0440\u0430\u0441\u0447\u0451\u0442\u0430 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438 \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u043c\u043e\u043a\u043e\u0434\u043e\u0432.<\/p>\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u2014 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0437\u0430\u043a\u0430\u0437 \u0432 \u043d\u0435\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u043c \u0441\u0442\u0430\u0442\u0443\u0441\u0435 <code>checkout-draft<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 WC \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0434\u043b\u044f \u00ab\u0432\u0438\u0441\u044f\u0449\u0438\u0445\u00bb \u043a\u043e\u0440\u0437\u0438\u043d:<\/p>\n<pre><code class=\"php\">public static function create_checkout( WP_REST_Request $request ) {    $body       = $request-&gt;get_json_params();    $session_id = $body['session_id'] ?? '';     \/\/ \u0418\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u044c: \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u043d \u043b\u0438 \u0443\u0436\u0435 \u0437\u0430\u043a\u0430\u0437 \u043f\u043e \u044d\u0442\u043e\u0439 \u0441\u0435\u0441\u0441\u0438\u0438    $existing = self::find_order_by_session( $session_id );    if ( $existing ) {        return rest_ensure_response([            'order_id' =&gt; $existing-&gt;get_id(),            'status'   =&gt; 'exists',        ]);    }     \/\/ \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0437\u0430\u043a\u0430\u0437 \u0432 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0442\u0430\u0442\u0443\u0441\u0435 draft    $order = wc_create_order( [        'status' =&gt; 'checkout-draft',    ] );     \/\/ \u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c session_id \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430    $order-&gt;update_meta_data( '_ycp_session_id', $session_id );    $order-&gt;update_meta_data( '_ycp_origin', 'yandex' );     \/\/ \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0442\u043e\u0432\u0430\u0440\u044b \u0438\u0437 \u0437\u0430\u043f\u0440\u043e\u0441\u0430    foreach ( $body['items'] as $item_data ) {        $product = self::find_product( $item_data['id'] );        if ( $product ) {            $order-&gt;add_product( $product, $item_data['quantity'] );        }    }     \/\/ \u0410\u0434\u0440\u0435\u0441 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438    if ( ! empty( $body['delivery_address'] ) ) {        $order-&gt;set_address( self::map_address( $body['delivery_address'] ), 'shipping' );    }     $order-&gt;calculate_totals();    $order-&gt;save();     return rest_ensure_response([        'order_id'   =&gt; $order-&gt;get_id(),        'status'     =&gt; 'created',        'session_id' =&gt; $session_id,    ]);}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0421\u0442\u0430\u0442\u0443\u0441 <code>checkout-draft<\/code> WC \u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u00ab\u0417\u0430\u043a\u0430\u0437\u044b\u00bb \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e (\u044d\u0442\u043e \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0442\u0430\u0442\u0443\u0441), \u043d\u0435 \u0448\u043b\u0451\u0442 \u043f\u0438\u0441\u0435\u043c, \u0438 \u043d\u0435 \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u0437\u0430\u043a\u0430\u0437 \u00ab\u0440\u0435\u0430\u043b\u044c\u043d\u043e \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u043d\u044b\u043c\u00bb. \u0422\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u0434\u0451\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 <code>placed<\/code>, \u043c\u044b \u043f\u0435\u0440\u0435\u0432\u0435\u0434\u0451\u043c \u0437\u0430\u043a\u0430\u0437 \u0432 <code>pending<\/code>, \u0438 \u0432\u043e\u0442 \u0442\u043e\u0433\u0434\u0430 WC \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432\u0441\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0445\u0443\u043a\u0438.<\/p>\n<p><strong>\u041b\u043e\u0432\u0443\u0448\u043a\u0430 2: \u0438\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u044c.<\/strong><\/p>\n<p>API \u042f\u043d\u0434\u0435\u043a\u0441\u0430 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442 at-least-once delivery \u2014 \u0442\u043e \u0435\u0441\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0439\u0442\u0438 \u0434\u0432\u0430\u0436\u0434\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0435\u0441\u043b\u0438 \u0443 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430 \u0431\u044b\u043b timeout \u043d\u0430 \u043e\u0442\u0432\u0435\u0442. \u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0437\u0430\u043a\u0430\u0437 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043f\u043e\u043b\u0443\u0447\u0438\u043c <strong>\u0434\u0432\u0430 \u0434\u0443\u0431\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e\u0433\u043e \u0436\u0435 \u0437\u0430\u043a\u0430\u0437\u0430<\/strong>.<\/p>\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u2014 \u043f\u043e\u0438\u0441\u043a \u043f\u043e <code>session_id<\/code> \u043f\u0435\u0440\u0435\u0434 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c:<\/p>\n<pre><code class=\"php\">private static function find_order_by_session( $session_id ) {    if ( empty( $session_id ) ) {        return null;    }     \/\/ HPOS-\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441    $orders = wc_get_orders([        'limit'      =&gt; 1,        'meta_key'   =&gt; '_ycp_session_id',        'meta_value' =&gt; $session_id,        'status'     =&gt; [ 'checkout-draft', 'pending', 'processing', 'on-hold' ],    ]);     return ! empty( $orders ) ? $orders[0] : null;}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0422\u0443\u0442 \u0432\u0442\u043e\u0440\u043e\u0439 \u0432\u0430\u0436\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u2014 <strong>HPOS (High-Performance Order Storage)<\/strong>. WooCommerce \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 8.0 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043d\u043e\u0432\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0437\u0430\u043a\u0430\u0437\u043e\u0432 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0445 \u0442\u0430\u0431\u043b\u0438\u0446 \u0432\u043c\u0435\u0441\u0442\u043e <code>wp_posts<\/code>. \u041d\u0430 \u043d\u043e\u0432\u044b\u0445 \u0441\u0430\u0439\u0442\u0430\u0445 \u043e\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043e \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u0415\u0441\u043b\u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u044f\u043c\u043e\u0439 SQL \u043a <code>wp_postmeta<\/code> (\u043a\u0430\u043a \u043c\u043d\u043e\u0433\u0438\u0435 \u0441\u0442\u0430\u0440\u044b\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u044b), \u043d\u0430 HPOS-\u0441\u0430\u0439\u0442\u0430\u0445 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043d\u0430\u0439\u0434\u0451\u0442\u0441\u044f.<\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0432\u0435\u0437\u0434\u0435 \u0432\u044b\u0441\u043e\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0435 <code>wc_get_orders()<\/code>, <code>$order-&gt;update_meta_data()<\/code>, <code>$order-&gt;get_meta()<\/code> \u2014 \u043e\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0432 \u043e\u0431\u043e\u0438\u0445 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430\u0445. \u042d\u0442\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0447\u0443\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u0438\u0441\u0446\u0438\u043f\u043b\u0438\u043d\u044b, \u043d\u043e \u043f\u043b\u0430\u0433\u0438\u043d \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u043c \u00ab\u043d\u0430\u0432\u0441\u0435\u0433\u0434\u0430\u00bb.<\/p>\n<hr\/>\n<h3>\u042d\u043d\u0434\u043f\u043e\u0438\u043d\u0442 4: checkout\/placed \u2014 \u0437\u0430\u043a\u0430\u0437 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0451\u043d<\/h3>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0430\u0436\u0430\u043b \u00ab\u041e\u043f\u043b\u0430\u0442\u0438\u0442\u044c\u00bb \u0432 \u0432\u0438\u0434\u0436\u0435\u0442\u0435 \u042f\u043d\u0434\u0435\u043a\u0441\u0430, \u043f\u0440\u0438\u043b\u0435\u0442\u0430\u0435\u0442 <code>placed<\/code>. \u0424\u0438\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0443\u043c\u043c\u0430, \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438, \u0441\u0442\u0430\u0442\u0443\u0441 \u043e\u043f\u043b\u0430\u0442\u044b \u2014 \u0432\u0441\u0451 \u0443\u0436\u0435 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u042f\u043d\u0434\u0435\u043a\u0441\u0430. \u041d\u0430\u0448\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u2014 \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 WC-\u0437\u0430\u043a\u0430\u0437 \u0438\u0437 <code>checkout-draft<\/code> \u0432 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u0430\u0442\u0443\u0441.<\/p>\n<pre><code class=\"php\">public static function checkout_placed( WP_REST_Request $request ) {    $body       = $request-&gt;get_json_params();    $session_id = $body['session_id'] ?? '';     $order = self::find_order_by_session( $session_id );    if ( ! $order ) {        return new WP_Error( 'order_not_found', 'No draft order for session', [ 'status' =&gt; 404 ] );    }     \/\/ \u0417\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435    $order-&gt;update_meta_data( '_ycp_yandex_order_id', $body['yandex_order_id'] );    $order-&gt;update_meta_data( '_ycp_payment_method', $body['payment_method'] );    $order-&gt;set_total( $body['total_amount'] );     \/\/ \u0421\u043f\u043e\u0441\u043e\u0431 \u043e\u043f\u043b\u0430\u0442\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0441\u0442\u0430\u0442\u0443\u0441    if ( $body['payment_status'] === 'paid' ) {        \/\/ \u041e\u043f\u043b\u0430\u0442\u0430 \u043f\u0440\u043e\u0448\u043b\u0430 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u042f\u043d\u0434\u0435\u043a\u0441\u0430 (\u042f\u043d\u0434\u0435\u043a\u0441 \u041f\u044d\u0439, \u0421\u043f\u043b\u0438\u0442) \u2192 processing        $order-&gt;update_status( 'processing', '\u041e\u043f\u043b\u0430\u0447\u0435\u043d\u043e \u0447\u0435\u0440\u0435\u0437 \u042f\u043d\u0434\u0435\u043a\u0441 \u0427\u0435\u043a\u0430\u0443\u0442' );    } else {        \/\/ \u041d\u0430\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u043f\u043b\u0430\u0442\u0451\u0436 \u2192 pending (\u043c\u0430\u0433\u0430\u0437\u0438\u043d \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441\u0430\u043c)        $order-&gt;update_status( 'pending', '\u0417\u0430\u043a\u0430\u0437 \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d, \u043e\u043f\u043b\u0430\u0442\u0430 \u043f\u0440\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438' );    }     return rest_ensure_response([        'status'   =&gt; 'ok',        'order_id' =&gt; $order-&gt;get_id(),    ]);}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0441\u0442\u0430\u0442\u0443\u0441 \u0437\u0430\u043a\u0430\u0437\u0430 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442 \u0438\u0437 <code>checkout-draft<\/code> \u0432 <code>pending<\/code> \u0438\u043b\u0438 <code>processing<\/code>, WooCommerce \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0443 \u043f\u0438\u0441\u044c\u043c\u043e \u0441 <strong>\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0443\u043c\u043c\u043e\u0439<\/strong>. \u042d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u0442\u043e\u0442 \u00ab\u0444\u043b\u043e\u0443 checkout-draft \u2192 pending\u00bb, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0448\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043f\u0443\u0441\u0442\u044b\u0445 \u043f\u0438\u0441\u0435\u043c.<\/p>\n<hr\/>\n<h3>\u042d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u044b 5\u201310: \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f<\/h3>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044e \u0432 reference manual, \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u044b \u043e\u043f\u0438\u0448\u0443 \u043a\u0440\u0430\u0442\u043a\u043e:<\/p>\n<p><code><strong>POST \/checkout\/cancel<\/strong><\/code> \u2014 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0437\u0430\u043a\u0440\u044b\u043b \u0432\u0438\u0434\u0436\u0435\u0442, \u043d\u0435 \u043e\u0444\u043e\u0440\u043c\u0438\u0432. \u0423\u0434\u0430\u043b\u044f\u0435\u043c draft-\u0437\u0430\u043a\u0430\u0437 \u0438\u043b\u0438 \u043f\u043e\u043c\u0435\u0447\u0430\u0435\u043c \u0435\u0433\u043e \u043a\u0430\u043a <code>cancelled<\/code>.<\/p>\n<p><code><strong>POST \/checkout\/delivery\/options<\/strong><\/code> \u2014 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438. \u0422\u0443\u0442 \u044f \u043f\u043e\u0434\u0442\u044f\u0433\u0438\u0432\u0430\u044e \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0438\u0437 WC Shipping, \u043f\u043b\u044e\u0441 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e \u00ab\u0441\u0430\u043c\u043e\u0432\u044b\u0432\u043e\u0437 \u0438\u0437 \u041f\u0412\u0417\u00bb.<\/p>\n<p><code><strong>GET \/checkout\/delivery\/pickup_points<\/strong><\/code> \u2014 \u0434\u043b\u044f \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u043e\u0432 \u0441 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c\u0438 \u041f\u0412\u0417. \u042f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0432 \u0430\u0434\u043c\u0438\u043d\u043a\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 UI \u00ab\u0441\u043f\u0438\u0441\u043e\u043a \u041f\u0412\u0417 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430\u00bb \u0441 CRUD-\u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u043c\u0438.<\/p>\n<p><code><strong>GET \/order<\/strong><\/code> \u2014 \u042f\u043d\u0434\u0435\u043a\u0441 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0441\u0442\u0430\u0442\u0443\u0441\u044b. \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0441\u0442\u0430\u0442\u0443\u0441\u0430 \u0437\u0430\u043a\u0430\u0437\u0430.<\/p>\n<p><code><strong>POST \/order\/cancel<\/strong><\/code> \u2014 \u043e\u0442\u043c\u0435\u043d\u0430 \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0437\u0430\u043a\u0430\u0437\u0430. \u041f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u043c WC-\u0437\u0430\u043a\u0430\u0437 \u0432 <code>cancelled<\/code>, \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0441\u0442\u043e\u043a.<\/p>\n<p><code><strong>POST \/order\/delivered<\/strong><\/code> \u2014 \u0437\u0430\u043a\u0430\u0437 \u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d. \u041f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u043c \u0437\u0430\u043a\u0430\u0437 \u0432 <code>completed<\/code>.<\/p>\n<p>\u0412\u0441\u0435 \u044d\u0442\u0438 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u044b \u0438\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u044b \u043f\u043e \u0442\u043e\u043c\u0443 \u0436\u0435 session_id \u0438\u043b\u0438 yandex_order_id, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0435 \u0434\u0435\u043b\u0430\u043b\u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u0432\u0440\u0435\u0434\u043d\u043e\u0433\u043e.<\/p>\n<hr\/>\n<h3>\u041b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435: \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043e\u0442\u043b\u0430\u0434\u043a\u0438<\/h3>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0448\u044c \u0441 \u0432\u043d\u0435\u0448\u043d\u0438\u043c API, \u0431\u0435\u0437 \u043b\u043e\u0433\u043e\u0432 \u0436\u0438\u0442\u044c \u043d\u0435\u043b\u044c\u0437\u044f. \u041d\u0430 \u043c\u043e\u0435\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043d\u0435\u0442 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u042f\u043d\u0434\u0435\u043a\u0441\u0430 \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u2014 \u044f \u043c\u043e\u0433\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0435\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043f\u0440\u0438\u043b\u0435\u0442\u0435\u043b\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u043e.<\/p>\n<p>\u042f \u043d\u0435 \u0441\u0442\u0430\u043b \u0442\u0430\u0449\u0438\u0442\u044c \u0444\u0430\u0439\u043b\u043e\u0432\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c \u0438\u043b\u0438 \u0411\u0414 \u2014 \u0434\u043b\u044f \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0445 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u043e\u0432 \u044d\u0442\u043e \u043b\u0438\u0448\u043d\u0438\u0439 overhead. \u0421\u0434\u0435\u043b\u0430\u043b \u043b\u043e\u0433 \u0432 WP option \u0441 \u0440\u043e\u0442\u0430\u0446\u0438\u0435\u0439 \u043f\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c 100 \u0437\u0430\u043f\u0438\u0441\u044f\u043c:<\/p>\n<pre><code class=\"php\">class YCP_Logger {    const OPTION_NAME = 'ycpy_log';    const MAX_ENTRIES = 100;     public static function log( $type, $endpoint, $request_body, $response, $error = null ) {        $log = get_option( self::OPTION_NAME, [] );         array_unshift( $log, [            'timestamp'    =&gt; current_time( 'mysql' ),            'type'         =&gt; $type, \/\/ REQUEST, RESPONSE, EXCEPTION            'endpoint'     =&gt; $endpoint,            'request_body' =&gt; is_string( $request_body )                               ? $request_body                               : wp_json_encode( $request_body ),            'response'     =&gt; is_string( $response )                               ? $response                               : wp_json_encode( $response ),            'error'        =&gt; $error,        ]);         \/\/ \u041e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 N \u0437\u0430\u043f\u0438\u0441\u0435\u0439        if ( count( $log ) &gt; self::MAX_ENTRIES ) {            $log = array_slice( $log, 0, self::MAX_ENTRIES );        }         update_option( self::OPTION_NAME, $log, false ); \/\/ autoload = false    }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0412\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0434 \u043a\u0430\u0436\u0434\u044b\u043c \u043e\u0442\u0432\u0435\u0442\u043e\u043c \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u0430, \u043f\u043b\u044e\u0441 \u0438\u0437 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0433\u043e try-catch \u043d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439. \u0412 \u0430\u0434\u043c\u0438\u043d\u043a\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u2014 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0435\u0439 \u043f\u043e \u0442\u0438\u043f\u0443. \u041a\u043e\u0433\u0434\u0430 \u043c\u0435\u0440\u0447\u0430\u043d\u0442 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u00ab\u0437\u0430\u043a\u0430\u0437 \u043d\u0435 \u043e\u0444\u043e\u0440\u043c\u043b\u044f\u0435\u0442\u0441\u044f\u00bb, \u043f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u044f \u043f\u0440\u043e\u0448\u0443 \u2014 \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u043b\u043e\u0433 \u0438 \u043d\u0430\u0439\u0442\u0438 \u0437\u0430\u043f\u0438\u0441\u044c \u0441 \u0442\u0438\u043f\u043e\u043c EXCEPTION. \u0427\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0442\u0430\u043c \u0441\u0440\u0430\u0437\u0443 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043f\u0440\u0438\u0441\u043b\u0430\u043b \u042f\u043d\u0434\u0435\u043a\u0441 \u0438 \u0433\u0434\u0435 \u0443\u043f\u0430\u043b\u043e.<\/p>\n<p><code>autoload = false<\/code> \u2014 \u0432\u0430\u0436\u043d\u044b\u0439 \u043d\u044e\u0430\u043d\u0441. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e WP-\u043e\u043f\u0446\u0438\u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u044e\u0442\u0441\u044f \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043a\u0430\u0436\u0434\u044b\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c \u043a \u0441\u0430\u0439\u0442\u0443. \u0415\u0441\u043b\u0438 \u043b\u043e\u0433 \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0439, \u044d\u0442\u043e \u0437\u0430\u043c\u0435\u0434\u043b\u0438\u0442 \u043a\u0430\u0436\u0434\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443. \u041e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u043c autoload \u2014 \u043e\u043f\u0446\u0438\u044f \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0433\u0434\u0430 \u044f\u0432\u043d\u043e \u0437\u0430\u043f\u0440\u043e\u0448\u0435\u043d\u0430.<\/p>\n<hr\/>\n<h3>\u0427\u0435\u043c\u0443 \u044f \u043d\u0430\u0443\u0447\u0438\u043b\u0441\u044f \u0437\u0430 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f<\/h3>\n<p>\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0440\u043e\u043a\u043e\u0432 \u0438\u0437 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438.<\/p>\n<p><strong>WC HPOS \u2014 \u044d\u0442\u043e \u0431\u0443\u0434\u0443\u0449\u0435\u0435, \u0438 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043d\u0435\u043b\u044c\u0437\u044f.<\/strong> \u0415\u0441\u043b\u0438 \u0431\u044b \u044f \u043f\u0438\u0441\u0430\u043b \u043f\u043b\u0430\u0433\u0438\u043d \u00ab\u043f\u043e-\u0441\u0442\u0430\u0440\u043e\u043c\u0443\u00bb \u0447\u0435\u0440\u0435\u0437 <code>$wpdb-&gt;postmeta<\/code>, \u043e\u043d \u0431\u044b \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0443 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u044b \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u043e\u0432. \u0412\u0441\u0435 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u0437\u0430\u043a\u0430\u0437\u043e\u0432 \u2014 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0440\u0435\u0437 WC API.<\/p>\n<p><strong>\u0418\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u044c \u0441 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0434\u043d\u044f.<\/strong> \u042f \u043c\u043e\u0433 \u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043d\u0430 \u0434\u0443\u0431\u043b\u0438 \u00ab\u043a\u043e\u0433\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u043e\u0442\u043e\u043c\u00bb. \u0412 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u044d\u0442\u043e \u0431\u044b \u043e\u0437\u043d\u0430\u0447\u0430\u043b\u043e \u043f\u0430\u0447\u043a\u0443 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u043a\u0430\u0437\u043e\u0432 \u043d\u0430 \u0431\u043e\u0435\u0432\u044b\u0445 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430\u0445 \u0432 \u043f\u0435\u0440\u0432\u044b\u0439 \u0436\u0435 \u0434\u0435\u043d\u044c. \u0414\u0435\u043b\u0430\u0439 \u0438\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u044c \u0441 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043a\u043e\u043c\u043c\u0438\u0442\u0430.<\/p>\n<p><strong>\u041b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u0435\u0444\u043e\u043b\u0442\u044b \u0434\u043b\u044f \u043d\u0435\u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/strong> \u041c\u0430\u0433\u0430\u0437\u0438\u043d\u044b \u2014 \u044d\u0442\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u0433\u0440\u044f\u0437\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. \u041f\u043e\u043b\u043e\u0432\u0438\u043d\u0430 \u0442\u043e\u0432\u0430\u0440\u043e\u0432 \u0431\u0435\u0437 \u0433\u0430\u0431\u0430\u0440\u0438\u0442\u043e\u0432, \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u044c \u2014 \u0431\u0435\u0437 \u0430\u0440\u0442\u0438\u043a\u0443\u043b\u043e\u0432, \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0434\u0435\u0441\u044f\u0442\u043e\u043c \u2014 \u043f\u0443\u0441\u0442\u044b\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f. \u041f\u043b\u0430\u0433\u0438\u043d, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u00ab\u0432\u0441\u0435 \u0442\u043e\u0432\u0430\u0440\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u044b\u00bb, \u043d\u0435 \u0432\u0437\u043b\u0435\u0442\u0438\u0442. \u041f\u043b\u0430\u0433\u0438\u043d \u0441 \u0440\u0430\u0437\u0443\u043c\u043d\u044b\u043c\u0438 \u0434\u0435\u0444\u043e\u043b\u0442\u0430\u043c\u0438 \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c\u0438 warning-\u0430\u043c\u0438 \u2014 \u0432\u0437\u043b\u0435\u0442\u0438\u0442.<\/p>\n<p><strong>\u041b\u043e\u0433 \u0432 \u0430\u0434\u043c\u0438\u043d\u043a\u0435 \u0432\u0430\u0436\u043d\u0435\u0435 \u043b\u044e\u0431\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438.<\/strong> \u041a\u043e\u0433\u0434\u0430 \u0443 \u043c\u0435\u0440\u0447\u0430\u043d\u0442\u0430 \u0447\u0442\u043e-\u0442\u043e \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043b\u0435\u0437\u0442\u044c \u0432 FTP \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <code>\/wp-content\/uploads\/ycp-logs\/<\/code>. \u041a\u043d\u043e\u043f\u043a\u0430 \u00ab\u041b\u043e\u0433 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432\u00bb \u043f\u0440\u044f\u043c\u043e \u0432 \u0430\u0434\u043c\u0438\u043d\u043a\u0435 \u0440\u0435\u0448\u0430\u0435\u0442 80% \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443.<\/p>\n<p><strong>\u0421\u0442\u0430\u0442\u0443\u0441 <\/strong><code><strong>checkout-draft<\/strong><\/code><strong> \u2014 \u043d\u0435\u0434\u043e\u043e\u0446\u0435\u043d\u0451\u043d\u043d\u0430\u044f \u0444\u0438\u0448\u043a\u0430 WooCommerce.<\/strong> \u0414\u043e \u044d\u0442\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u044f \u043e \u043d\u0451\u043c \u043d\u0435 \u0437\u043d\u0430\u043b. \u042d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e \u0434\u043b\u044f \u043b\u044e\u0431\u044b\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432 \u00ab\u043e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u043a\u0430\u0437\u0430\u00bb \u2014 \u043a\u043e\u0440\u0437\u0438\u043d\u044b \u0441 saved later, multi-step checkout, \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u2014 \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0447\u0435\u043a\u0430\u0443\u0442\u044b \u0432\u0440\u043e\u0434\u0435 \u042f\u043d\u0434\u0435\u043a\u0441\u0430.<\/p>\n<hr\/>\n<h3>\u0427\u0442\u043e \u0434\u0430\u043b\u044c\u0448\u0435<\/h3>\n<p>\u041f\u043b\u0430\u0433\u0438\u043d \u0441\u0435\u0439\u0447\u0430\u0441 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 10 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u043e\u0432 YCP v1 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0431\u043e\u0435\u0432\u044b\u0445 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430\u0445, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u043c\u043e\u0439. \u0418\u0437 \u043f\u043b\u0430\u043d\u043e\u0432:<\/p>\n<ul>\n<li>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 multi-warehouse (\u042f\u043d\u0434\u0435\u043a\u0441 \u044d\u0442\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442, \u043d\u043e \u044f \u043f\u043e\u043a\u0430 \u0432\u044b\u043d\u0435\u0441 \u043d\u0430\u0440\u0443\u0436\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0441\u043a\u043b\u0430\u0434)<\/p>\n<\/li>\n<li>\n<p>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441 WC Multilingual \u0434\u043b\u044f \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u043e\u0432 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u044f\u0437\u044b\u043a\u0430\u0445<\/p>\n<\/li>\n<li>\n<p>Bulk-\u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u043e \u043c\u0430\u0441\u0441\u043e\u0432\u043e\u043c\u0443 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0443 \u0442\u043e\u0432\u0430\u0440\u043e\u0432 \u0432 \u042f\u043d\u0434\u0435\u043a\u0441 \u0422\u043e\u0432\u0430\u0440\u044b (\u0441\u0435\u0439\u0447\u0430\u0441 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 YML-\u0444\u0438\u0434)<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043f\u0430\u0440\u0442\u0438\u0430\u043b-\u043e\u043f\u043b\u0430\u0442 \u0438 \u043f\u043e\u0434\u043f\u0438\u0441\u043e\u0447\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u0435\u0441\u043b\u0438 \u042f\u043d\u0434\u0435\u043a\u0441 \u0438\u0445 \u043e\u0442\u043a\u0440\u043e\u0435\u0442 \u0432 YCP v2 \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0442\u043e\u0436\u0435 WooCommerce, \u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u0440\u043e\u0434\u0430\u0436\u0438 \u0447\u0435\u0440\u0435\u0437 \u0410\u043b\u0438\u0441\u0443 AI \u2014 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u043f\u043b\u0430\u0433\u0438\u043d. GPL-2.0, \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043f\u043e issue \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438: <a href=\"https:\/\/github.com\/perfinn\/YCP-Yandex-Commerce-Woocommerce\" rel=\"noopener noreferrer nofollow\">github.com\/perfinn\/YCP-Yandex-Commerce-Woocommerce<\/a>.<\/p>\n<\/li>\n<\/ul>\n<p>PR \u0438 \u0431\u0430\u0433-\u0440\u0435\u043f\u043e\u0440\u0442\u044b \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0444\u0438\u0434\u0431\u0435\u043a \u043e\u0442 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u043e\u0432 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0430\u0441\u0441\u043e\u0440\u0442\u0438\u043c\u0435\u043d\u0442\u043e\u043c (10k+ \u0442\u043e\u0432\u0430\u0440\u043e\u0432) \u2014 \u043d\u0430 \u043c\u043e\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0441\u0442\u0435\u043d\u0434\u0430\u0445 \u0442\u0430\u043a\u0438\u0445 \u043e\u0431\u044a\u0451\u043c\u043e\u0432 \u043d\u0435 \u0431\u044b\u043b\u043e, \u0438 \u0433\u0434\u0435-\u0442\u043e \u043c\u043e\u0433\u0443\u0442 \u0432\u044b\u043b\u0435\u0437\u0442\u0438 \u0443\u0437\u043a\u0438\u0435 \u043c\u0435\u0441\u0442\u0430 \u043f\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/p>\n<hr\/>\n<p><em>\u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438:<\/em><\/p>\n<ul>\n<li>\n<p><em>\u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043f\u043b\u0430\u0433\u0438\u043d\u0430: <\/em><a href=\"https:\/\/github.com\/perfinn\/YCP-Yandex-Commerce-Woocommerce\" rel=\"noopener noreferrer nofollow\"><em>github.com\/perfinn\/YCP-Yandex-Commerce-Woocommerce<\/em><\/a><\/p>\n<\/li>\n<li>\n<p><em>\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f YCP \u043e\u0442 \u042f\u043d\u0434\u0435\u043a\u0441\u0430: <\/em><a href=\"https:\/\/merchants.yandex.ru\/ycp\" rel=\"noopener noreferrer nofollow\"><em>merchants.yandex.ru\/ycp<\/em><\/a><\/p>\n<\/li>\n<li>\n<p><em>WooCommerce HPOS docs: <\/em><a href=\"https:\/\/woocommerce.com\/document\/high-performance-order-storage\/\" rel=\"noopener noreferrer nofollow\"><em>woocommerce.com\/document\/high-performance-order-storage<\/em><\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<p>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/1037654\/\">https:\/\/habr.com\/ru\/articles\/1037654\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0420\u0430\u0437\u0431\u0438\u0440\u0430\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430 \u043d\u0430 WordPress + WooCommerce \u0441 YCP \u2014 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u043c \u042f\u043d\u0434\u0435\u043a\u0441\u0430 \u0434\u043b\u044f \u043f\u043e\u043a\u0443\u043f\u043e\u043a \u0447\u0435\u0440\u0435\u0437 \u0410\u043b\u0438\u0441\u0443 AI, \u041f\u043e\u0438\u0441\u043a \u0438 \u0420\u0438\u0442\u043c\u0412 \u043a\u043e\u043d\u0446\u0435 \u043c\u0430\u044f 2026 \u042f\u043d\u0434\u0435\u043a\u0441 \u043e\u0442\u043a\u0440\u044b\u043b Yandex Commerce Protocol \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u2014 \u0442\u0435\u043f\u0435\u0440\u044c \u043b\u044e\u0431\u043e\u0439 \u043e\u043d\u043b\u0430\u0439\u043d-\u043c\u0430\u0433\u0430\u0437\u0438\u043d \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u0440\u043e\u0434\u0430\u0436\u0438 \u0447\u0435\u0440\u0435\u0437 \u0410\u043b\u0438\u0441\u0443 AI, \u041f\u043e\u0438\u0441\u043a \u0438 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043b\u0435\u043d\u0442\u0443 \u0420\u0438\u0442\u043c. \u0418\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0435\u0441\u0442\u044c \u0434\u043b\u044f \u042f\u043d\u0434\u0435\u043a\u0441 KIT, \u042f\u043d\u0434\u0435\u043a\u0441 \u041c\u0430\u0440\u043a\u0435\u0442\u0430 \u0438 1\u0421-\u0411\u0438\u0442\u0440\u0438\u043a\u0441. \u0414\u043b\u044f \u0432\u0441\u0435\u0433\u043e \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u2014 API.\u0423 \u043c\u0435\u043d\u044f \u043c\u0430\u0433\u0430\u0437\u0438\u043d \u043d\u0430 WooCommerce, \u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u00ab\u043d\u0430\u0436\u0430\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443 \u0438 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e\u00bb \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u043d\u0435 \u0431\u044b\u043b\u043e. \u042f \u043c\u043e\u0433 \u043b\u0438\u0431\u043e \u0436\u0434\u0430\u0442\u044c, \u043f\u043e\u043a\u0430 \u042f\u043d\u0434\u0435\u043a\u0441 \u0438\u043b\u0438 \u043a\u0442\u043e-\u0442\u043e \u0435\u0449\u0451 \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u0434\u043b\u044f WordPress (\u0441 \u043d\u0435\u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u044b\u043c ETA), \u043b\u0438\u0431\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441 API \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d \u0441\u0430\u043c. \u0412\u044b\u0431\u0440\u0430\u043b \u0432\u0442\u043e\u0440\u043e\u0435. \u041d\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0443\u0448\u043b\u043e \u043e\u043a\u043e\u043b\u043e \u0434\u0432\u0443\u0445 \u043d\u0435\u0434\u0435\u043b\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e \u0432\u0435\u0447\u0435\u0440\u0430\u043c, \u043f\u043b\u044e\u0441 \u0435\u0449\u0451 \u043d\u0435\u0434\u0435\u043b\u044f \u043d\u0430 \u043e\u0442\u043b\u0430\u0434\u043a\u0443 \u0441 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u043c \u043a\u0430\u0431\u0438\u043d\u0435\u0442\u043e\u043c \u042f\u043d\u0434\u0435\u043a\u0441\u0430. \u041f\u043e \u0438\u0442\u043e\u0433\u0443 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f open-source \u043f\u043b\u0430\u0433\u0438\u043d \u043d\u0430 GPL-2.0, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0437\u0430\u043a\u0440\u044b\u0442\u044b \u0432\u0441\u0435 10 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u043e\u0432 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 YCP v1: github.com\/perfinn\/YCP-Yandex-Commerce-Woocommerce.\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0443 \u043d\u0435 \u00ab\u043a\u0430\u043a \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c\u00bb (\u044d\u0442\u043e \u0432 README), \u0430 \u043a\u0430\u043a \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f: \u043a\u0430\u043a\u0438\u0435 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u044b \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c, \u043a\u0430\u043a \u043c\u0430\u043f\u043f\u0438\u0442\u044c \u0437\u0430\u043a\u0430\u0437\u044b \u0438\u0437 \u042f\u043d\u0434\u0435\u043a\u0441\u0430 \u0432 WC, \u0433\u0434\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u043d\u0430 \u0433\u0440\u0430\u0431\u043b\u0438 (\u0441\u0442\u0430\u0442\u0443\u0441\u044b \u0437\u0430\u043a\u0430\u0437\u043e\u0432, \u043f\u0438\u0441\u044c\u043c\u0430, HPOS-\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c), \u0438 \u043f\u043e\u0447\u0435\u043c\u0443 \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0438\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u044c \u043f\u043e session_id \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u043d\u0430\u0447\u0430\u043b\u0430. \u041c\u043e\u0436\u0435\u0442, \u043a\u043e\u043c\u0443-\u0442\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043b\u0438\u0431\u043e \u0432\u0437\u044f\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d \u043f\u043e\u0434 \u0441\u0432\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u043b\u0438\u0431\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0430\u043d\u0430\u043b\u043e\u0433 \u043f\u043e\u0434 \u0434\u0440\u0443\u0433\u0443\u044e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443.\u0427\u0442\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u0434\u0435\u043b\u0430\u0435\u0442 YCP \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b\u0427\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u043c\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u2014 \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0431\u0437\u043e\u0440 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430.YCP \u2014 \u044d\u0442\u043e HTTPS REST API \u043e\u0442 \u042f\u043d\u0434\u0435\u043a\u0441\u0430 \u043a \u0432\u0430\u0448\u0435\u043c\u0443 \u0441\u0430\u0439\u0442\u0443. \u041d\u0435 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442. \u0422\u043e \u0435\u0441\u0442\u044c \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043a\u0443\u043f\u0430\u0442\u0435\u043b\u044c \u0432 \u0410\u043b\u0438\u0441\u0435 \u0438\u043b\u0438 \u041f\u043e\u0438\u0441\u043a\u0435 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u0442 \u00ab\u041a\u0443\u043f\u0438\u0442\u044c \u0432 1 \u043a\u043b\u0438\u043a\u00bb, \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043b\u0435\u0442\u044f\u0442 \u043e\u0442 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u042f\u043d\u0434\u0435\u043a\u0441\u0430 \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430. \u041c\u0430\u0433\u0430\u0437\u0438\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0430\u0431\u043e\u0440 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u043e\u0432, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u042f\u043d\u0434\u0435\u043a\u0441 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0442\u043e\u0432\u0430\u0440\u0430\u0445, \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0443, \u043e\u0444\u043e\u0440\u043c\u043b\u044f\u0435\u0442 \u0437\u0430\u043a\u0430\u0437 \u0438 \u043f\u043e\u0442\u043e\u043c \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0435\u0433\u043e \u0441\u0442\u0430\u0442\u0443\u0441.\u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043c\u0430\u0440\u043a\u0435\u0442\u043f\u043b\u0435\u0439\u0441-\u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0439 (\u0433\u0434\u0435 \u043c\u0430\u0433\u0430\u0437\u0438\u043d \u0432\u044b\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0444\u0438\u0434 \u0438 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u0442), \u0442\u0443\u0442 \u0434\u0432\u0443\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0439 live-\u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b. \u041a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u0438\u0434\u0438\u0442 \u0442\u043e\u0432\u0430\u0440 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u0445 \u0410\u043b\u0438\u0441\u044b \u2014 \u042f\u043d\u0434\u0435\u043a\u0441 \u0434\u0435\u043b\u0430\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043a \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0443 \u00ab\u0443\u0442\u043e\u0447\u043d\u0438 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u0446\u0435\u043d\u0443 \u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0435\u00bb. \u041a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u0447\u0442\u043e-\u0442\u043e \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u043e \u0441\u0442\u0430\u0442\u0443\u0441\u043e\u043c \u0437\u0430\u043a\u0430\u0437\u0430 \u2014 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u0447\u0435\u0440\u0435\u0437 API.\u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043f\u043b\u0430\u0433\u0438\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0434\u0435\u0440\u0436\u0430\u0442\u044c REST API \u0432\u0441\u0435\u0433\u0434\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c, \u0431\u044b\u0441\u0442\u0440\u044b\u043c \u0438 \u0438\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u044b\u043c. \u0418 \u0442\u0443\u0442 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435.\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u043b\u0430\u0433\u0438\u043d\u0430\u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u044b, \u043f\u043e\u043a\u0430\u0436\u0443 \u043e\u0431\u0449\u0438\u0439 \u0441\u043a\u0435\u043b\u0435\u0442. WordPress-\u043f\u043b\u0430\u0433\u0438\u043d \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u043f\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0441\u0445\u0435\u043c\u0435: \u0433\u043b\u0430\u0432\u043d\u044b\u0439 PHP-\u0444\u0430\u0439\u043b \u0441 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u043c \u043f\u043b\u0430\u0433\u0438\u043d\u0430, \u043a\u043b\u0430\u0441\u0441\u044b \u043f\u043e\u0434 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438, action\/filter \u0445\u0443\u043a\u0438 \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0441 WP \u0438 WooCommerce.yandex-ycp-woo\/\u251c\u2500\u2500 yandex-ycp-woo.php       # \u0413\u043b\u0430\u0432\u043d\u044b\u0439 \u0444\u0430\u0439\u043b, \u0445\u0443\u043a\u0438 \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438, \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f\u251c\u2500\u2500 includes\/\u2502   \u251c\u2500\u2500 class-ycp-rest.php       # \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f REST API \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u043e\u0432\u2502   \u251c\u2500\u2500 class-ycp-auth.php       # Bearer-\u0442\u043e\u043a\u0435\u043d \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f\u2502   \u251c\u2500\u2500 class-ycp-checkout.php   # \u041b\u043e\u0433\u0438\u043a\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0437\u0430\u043a\u0430\u0437\u0430 \u0438\u0437 \u042f\u043d\u0434\u0435\u043a\u0441\u0430\u2502   \u251c\u2500\u2500 class-ycp-delivery.php   # \u0412\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438 (\u0421\u0414\u042d\u041a, \u041f\u0412\u0417)\u2502   \u251c\u2500\u2500 class-ycp-orders.php     # \u041c\u0430\u043f\u043f\u0438\u043d\u0433 \u0442\u043e\u0432\u0430\u0440\u043e\u0432, \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u0443\u0441\u043e\u0432\u2502   \u251c\u2500\u2500 class-ycp-logger.php     # \u041b\u043e\u0433 \u0432 WP option (\u0434\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438)\u2502   \u2514\u2500\u2500 class-ycp-admin.php      # \u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0432 \u0430\u0434\u043c\u0438\u043d\u043a\u0435\u251c\u2500\u2500 assets\/\u2502   \u2514\u2500\u2500 admin.css\u2514\u2500\u2500 readme.txt                   # \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442 WordPress.org\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u043e\u0432 \u0438\u0434\u0451\u0442 \u0447\u0435\u0440\u0435\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0434\u043b\u044f WP \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c register_rest_route \u0432 action rest_api_init:add_action( &#8216;rest_api_init&#8217;, function() {    $namespace = &#8216;ycp\/v1&#8217;;     \/\/ GET \/ycp\/v1\/warehouses    register_rest_route( $namespace, &#8216;\/warehouses&#8217;, [        &#8216;methods&#8217;             =&gt; &#8216;GET&#8217;,        &#8216;callback&#8217;            =&gt; [ &#8216;YCP_Rest&#8217;, &#8216;get_warehouses&#8217; ],        &#8216;permission_callback&#8217; =&gt; [ &#8216;YCP_Auth&#8217;, &#8216;check_bearer&#8217; ],    ]);     \/\/ POST \/ycp\/v1\/checkout    register_rest_route( $namespace, &#8216;\/checkout&#8217;, [        &#8216;methods&#8217;             =&gt; &#8216;POST&#8217;,        &#8216;callback&#8217;            =&gt; [ &#8216;YCP_Rest&#8217;, &#8216;create_checkout&#8217; ],        &#8216;permission_callback&#8217; =&gt; [ &#8216;YCP_Auth&#8217;, &#8216;check_bearer&#8217; ],    ]);     \/\/ &#8230; \u0435\u0449\u0451 8 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u043e\u0432});\u0417\u0434\u0435\u0441\u044c \u0432\u0430\u0436\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441 permission_callback. \u042d\u0442\u043e \u043d\u0435 \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u0448\u0442\u0443\u043a\u0430, \u044d\u0442\u043e \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 WP REST API. \u0415\u0441\u043b\u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0442\u0443\u0434\u0430 __return_true, WordPress \u0431\u0443\u0434\u0435\u0442 \u0440\u0443\u0433\u0430\u0442\u044c\u0441\u044f, \u0438 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442 \u0441\u0442\u0430\u043d\u0435\u0442 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c \u0431\u0435\u0437 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438. \u0427\u0442\u043e \u0434\u043b\u044f \u043f\u043b\u0430\u0442\u0451\u0436\u043d\u043e\u0433\u043e API \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e.\u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0432 YCP \u0438\u0434\u0451\u0442 \u043f\u043e Bearer-\u0442\u043e\u043a\u0435\u043d\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u042f\u043d\u0434\u0435\u043a\u0441 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0432 \u043a\u0430\u0431\u0438\u043d\u0435\u0442\u0435 \u0438 \u043f\u0440\u0438\u0441\u044b\u043b\u0430\u0435\u0442 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435:class YCP_Auth {    public static function check_bearer( WP_REST_Request $request ) {        $stored_token = get_option( &#8216;ycpy_bearer_token&#8217; );        if ( empty( $stored_token ) ) {            return new WP_Error( &#8216;no_token_configured&#8217;, &#8216;Token not set&#8217;, [ &#8216;status&#8217; =&gt; 503 ] );        }         \/\/ \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u2014 Authorization: Bearer &#8230;        $auth = $request-&gt;get_header( &#8216;authorization&#8217; );        if ( $auth &amp;&amp; stripos( $auth, &#8216;Bearer &#8216; ) === 0 ) {            $token = trim( substr( $auth, 7 ) );            if ( hash_equals( $stored_token, $token ) ) {                return true;            }        }         \/\/ Fallback \u043d\u0430 X-API-Key \u2014 \u0438\u043d\u043e\u0433\u0434\u0430 \u0442\u0430\u043a \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 curl        $api_key = $request-&gt;get_header( &#8216;x_api_key&#8217; );        if ( $api_key &amp;&amp; hash_equals( $stored_token, $api_key ) ) {            return true;        }         return new WP_Error( &#8216;unauthorized&#8217;, &#8216;Invalid token&#8217;, [ &#8216;status&#8217; =&gt; 401 ] );    }}\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 hash_equals \u0432\u043c\u0435\u0441\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e === \u2014 \u044d\u0442\u043e \u0437\u0430\u0449\u0438\u0442\u0430 \u043e\u0442 timing attacks. \u0414\u043b\u044f \u043f\u043b\u0430\u0442\u0451\u0436\u043d\u043e\u0433\u043e API \u0442\u0430\u043a\u0430\u044f \u043c\u0435\u043b\u043e\u0447\u044c \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u0430, \u0438 WordPress-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0447\u0430\u0441\u0442\u043e \u0435\u0451 \u0437\u0430\u0431\u044b\u0432\u0430\u044e\u0442.\u042d\u043d\u0434\u043f\u043e\u0438\u043d\u0442 1: warehouses\u0421\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439. \u042f\u043d\u0434\u0435\u043a\u0441 \u043f\u0440\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0430\u0448\u0438\u0445 \u0441\u043a\u043b\u0430\u0434\u043e\u0432. \u0418\u0437 \u0430\u0434\u043c\u0438\u043d\u043a\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u044f \u0434\u0430\u044e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u043a\u043b\u0430\u0434 \u2014 \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u043c\u0435\u043b\u043a\u0438\u0445 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u043e\u0432 \u043d\u0430 WooCommerce \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e.public static function get_warehouses( WP_REST_Request $request ) {    $warehouse = [        &#8216;id&#8217;      =&gt; &#8216;main&#8217;,        &#8216;name&#8217;    =&gt; get_option( &#8216;ycpy_warehouse_name&#8217;, &#8216;\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u043a\u043b\u0430\u0434&#8217; ),        &#8216;address&#8217; =&gt; [            &#8216;country&#8217;  =&gt; &#8216;RU&#8217;,            &#8216;city&#8217;     =&gt; get_option( &#8216;ycpy_warehouse_city&#8217; ),            &#8216;street&#8217;   =&gt; get_option( &#8216;ycpy_warehouse_street&#8217; ),            &#8216;building&#8217; =&gt; get_option( &#8216;ycpy_warehouse_building&#8217; ),        ],        &#8216;phone&#8217;   =&gt; get_option( &#8216;ycpy_warehouse_phone&#8217; ),    ];     return rest_ensure_response([        &#8216;warehouses&#8217; =&gt; [ $warehouse ],    ]);}\u0422\u0443\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e, \u043d\u043e \u043e\u0431\u0440\u0430\u0449\u0443 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 rest_ensure_response() \u2014 \u044d\u0442\u043e WP-\u043e\u0431\u0451\u0440\u0442\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u043e\u0442\u0432\u0435\u0442\u0430 \u0441 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430\u043c\u0438. \u0411\u0435\u0437 \u043d\u0435\u0451 \u043c\u043e\u0436\u0435\u0442 \u0443\u043b\u0435\u0442\u0435\u0442\u044c \u0433\u043e\u043b\u044b\u0439 array, \u0438 \u042f\u043d\u0434\u0435\u043a\u0441 \u043d\u0435 \u0440\u0430\u0441\u043f\u0430\u0440\u0441\u0438\u0442.\u042d\u043d\u0434\u043f\u043e\u0438\u043d\u0442 2: basket\/check \u2014 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043a\u043e\u0440\u0437\u0438\u043d\u044b\u0412\u043e\u0442 \u044d\u0442\u043e \u0443\u0436\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e. \u041a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u043c\u043e\u0442\u0440\u0438\u0442 \u0442\u043e\u0432\u0430\u0440 \u0432 \u0410\u043b\u0438\u0441\u0435 \u0438 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u0442 \u00ab\u041a\u0443\u043f\u0438\u0442\u044c\u00bb, \u042f\u043d\u0434\u0435\u043a\u0441 \u043f\u0435\u0440\u0435\u0434 \u043f\u043e\u043a\u0430\u0437\u043e\u043c \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0447\u0435\u043a\u0430\u0443\u0442\u0430 \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u043c\u0430\u0433\u0430\u0437\u0438\u043d: \u00ab\u0443 \u043d\u0430\u0441 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0435 \u0432\u043e\u0442 \u044d\u0442\u0438 \u0442\u043e\u0432\u0430\u0440\u044b \u2014 \u043e\u043d\u0438 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435, \u0446\u0435\u043d\u044b \u0442\u0435 \u0436\u0435, \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0435\u0441\u0442\u044c, \u0433\u0430\u0431\u0430\u0440\u0438\u0442\u044b \u0434\u043b\u044f \u0440\u0430\u0441\u0447\u0451\u0442\u0430 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438 \u043a\u0430\u043a\u0438\u0435?\u00bb.public static function basket_check( WP_REST_Request $request ) {    $body  = $request-&gt;get_json_params();    $items = $body[&#8216;items&#8217;] ?? [];     $checked_items = [];    $unavailable   = [];     foreach ( $items as $item ) {        $product = self::find_product( $item[&#8216;id&#8217;] );         if ( ! $product || ! $product-&gt;is_in_stock() ) {            $unavailable[] = [ &#8216;id&#8217; =&gt; $item[&#8216;id&#8217;], &#8216;reason&#8217; =&gt; &#8216;out_of_stock&#8217; ];            continue;        }         $checked_items[] = [            &#8216;id&#8217;         =&gt; $item[&#8216;id&#8217;],            &#8216;price&#8217;      =&gt; self::format_money( $product-&gt;get_price() ),            &#8216;currency&#8217;   =&gt; &#8216;RUB&#8217;,            &#8216;quantity&#8217;   =&gt; $item[&#8216;quantity&#8217;],            &#8216;available&#8217;  =&gt; $product-&gt;get_stock_quantity() ?? 999,            &#8216;dimensions&#8217; =&gt; self::get_product_dimensions( $product ),        ];    }     return rest_ensure_response([        &#8216;items&#8217;       =&gt; $checked_items,        &#8216;unavailable&#8217; =&gt; $unavailable,    ]);}\u041c\u0430\u043f\u043f\u0438\u043d\u0433 \u0442\u043e\u0432\u0430\u0440\u043e\u0432 \u2014 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u044f. \u042f\u043d\u0434\u0435\u043a\u0441 \u043f\u0440\u0438\u0441\u044b\u043b\u0430\u0435\u0442 id \u0442\u043e\u0432\u0430\u0440\u0430, \u0438 \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u044d\u0442\u043e: SKU \u0432 WC \u0438\u043b\u0438 \u0447\u0438\u0441\u043b\u043e\u0432\u043e\u0439 post_id WooCommerce-\u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430. \u042f \u0441\u0434\u0435\u043b\u0430\u043b \u0434\u0432\u043e\u0439\u043d\u043e\u0439 \u043f\u043e\u0438\u0441\u043a:private static function find_product( $id ) {    \/\/ 1. \u041f\u0440\u043e\u0431\u0443\u0435\u043c \u043a\u0430\u043a SKU (\u0430\u0440\u0442\u0438\u043a\u0443\u043b)    $product_id = wc_get_product_id_by_sku( $id );    if ( $product_id ) {        return wc_get_product( $product_id );    }     \/\/ 2. \u0415\u0441\u043b\u0438 ID \u0447\u0438\u0441\u043b\u043e\u0432\u043e\u0439 \u2014 \u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043a\u0430\u043a post_id    if ( is_numeric( $id ) ) {        $product = wc_get_product( (int) $id );        if ( $product &amp;&amp; $product-&gt;exists() ) {            return $product;        }    }     return null;}\u042d\u0442\u043e \u0433\u0438\u0431\u043a\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u2014 \u043c\u0435\u0440\u0447\u0430\u043d\u0442 \u043c\u043e\u0436\u0435\u0442 \u0432 \u0444\u0438\u0434\u0435 \u042f\u043d\u0434\u0435\u043a\u0441\u0430 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0447\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u0435\u0435: SKU \u0438\u043b\u0438 \u0447\u0438\u0441\u043b\u043e\u0432\u043e\u0439 ID WC-\u0442\u043e\u0432\u0430\u0440\u0430. \u0413\u043b\u0430\u0432\u043d\u043e\u0435, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438 \u043c\u0430\u043f\u043f\u0438\u043d\u0433\u0435 \u0432 \u043e\u0431\u0440\u0430\u0442\u043d\u0443\u044e \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u0432\u0441\u0451 \u043d\u0430\u0448\u043b\u043e\u0441\u044c.\u0421 \u0433\u0430\u0431\u0430\u0440\u0438\u0442\u0430\u043c\u0438 \u0442\u043e\u0436\u0435 \u0435\u0441\u0442\u044c \u043d\u044e\u0430\u043d\u0441. WooCommerce \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u0434\u0430\u0451\u0442 \u043f\u043e\u043b\u044f weight, length, width, height \u2014 \u043d\u043e \u043c\u043d\u043e\u0433\u0438\u0435 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u044b \u0438\u0445 \u043d\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u044e\u0442. \u0410 \u0431\u0435\u0437 \u0433\u0430\u0431\u0430\u0440\u0438\u0442\u043e\u0432 \u042f\u043d\u0434\u0435\u043a\u0441 \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438 \u0421\u0414\u042d\u041a, \u0438 \u0437\u0430\u043a\u0430\u0437 \u043d\u0435 \u043e\u0444\u043e\u0440\u043c\u0438\u0442\u0441\u044f. \u042f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0442\u043e\u0432\u0430\u0440\u043e\u0432 \u0431\u0435\u0437 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432:private static function get_product_dimensions( $product ) {    $weight = $product-&gt;get_weight() ?: get_option( &#8216;ycpy_default_weight&#8217;, 0.5 );    $length = $product-&gt;get_length() ?: get_option( &#8216;ycpy_default_length&#8217;, 15 );    $width  = $product-&gt;get_width()  ?: get_option( &#8216;ycpy_default_width&#8217;, 10 );    $height = $product-&gt;get_height() ?: get_option( &#8216;ycpy_default_height&#8217;, 5 );     return [        &#8216;weight&#8217; =&gt; (float) $weight,        &#8216;length&#8217; =&gt; (float) $length,        &#8216;width&#8217;  =&gt; (float) $width,        &#8216;height&#8217; =&gt; (float) $height,    ];}\u0414\u0435\u0444\u043e\u043b\u0442\u044b \u0437\u0430\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u0430\u0434\u043c\u0438\u043d\u043a\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u2014 \u044d\u0442\u043e \u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0438\u0441\u0441 \u043c\u0435\u0436\u0434\u0443 \u00ab\u043c\u0430\u0433\u0430\u0437\u0438\u043d \u043e\u0431\u044f\u0437\u0430\u043d \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u0432\u0441\u0435\u0445 \u0442\u043e\u0432\u0430\u0440\u043e\u0432\u00bb \u0438 \u00ab\u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0447\u0442\u043e-\u0442\u043e \u043e\u0442\u0434\u0430\u0434\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043a\u0430\u0437 \u0445\u043e\u0442\u044f \u0431\u044b \u043f\u0440\u043e\u0448\u0451\u043b\u00bb. \u042f \u0432\u044b\u0431\u0438\u0440\u0430\u044e \u00ab\u043b\u0443\u0447\u0448\u0435 \u043e\u0442\u0434\u0430\u0442\u044c \u0434\u0435\u0444\u043e\u043b\u0442 \u0438 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0434\u0438\u0442\u044c \u043c\u0435\u0440\u0447\u0430\u043d\u0442\u0430\u00bb, \u0447\u0435\u043c \u00ab\u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u043f\u043e\u043a\u0443\u043f\u043a\u0435\u00bb.\u042d\u043d\u0434\u043f\u043e\u0438\u043d\u0442 3: checkout \u2014 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0437\u0430\u043a\u0430\u0437\u0430\u0421\u0430\u043c\u044b\u0439 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442. \u042d\u0442\u043e \u043a\u043e\u0433\u0434\u0430 \u042f\u043d\u0434\u0435\u043a\u0441 \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u0445\u043e\u0447\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0443 \u043d\u0430\u0441 \u0432 WC \u043d\u043e\u0432\u044b\u0439 \u0437\u0430\u043a\u0430\u0437. \u0418 \u0442\u0443\u0442 \u0441\u0430\u043c\u0430\u044f \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u043b\u043e\u0432\u0443\u0448\u043a\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u043d\u0430\u0441\u0442\u0443\u043f\u0438\u043b \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438.\u041b\u043e\u0432\u0443\u0448\u043a\u0430 1: \u043f\u0438\u0441\u044c\u043c\u0430 \u00ab\u041d\u043e\u0432\u044b\u0439 \u0437\u0430\u043a\u0430\u0437 \u043d\u0430 0 \u20bd\u00bb.\u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0437\u0430\u043a\u0430\u0437 \u0432 WC \u0447\u0435\u0440\u0435\u0437 wc_create_order() \u0441\u043e \u0441\u0442\u0430\u0442\u0443\u0441\u043e\u043c pending, WooCommerce&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-480494","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/480494","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=480494"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/480494\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=480494"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=480494"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=480494"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}