{"id":7817,"date":"2024-02-07T05:00:47","date_gmt":"2024-02-07T05:00:47","guid":{"rendered":"https:\/\/musilda.cz\/?p=7817"},"modified":"2024-02-07T05:00:47","modified_gmt":"2024-02-07T05:00:47","slug":"legacy-rest-api-se-ve-woocommerce-9-0-jiz-neobjevi","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/legacy-rest-api-se-ve-woocommerce-9-0-jiz-neobjevi\/","title":{"rendered":"Legacy REST API se ve WooCommerce 9.0 ji\u017e neobjev\u00ed"},"content":{"rendered":"\n

Ji\u017e WooCommerce verze 2.6(vyd\u00e1na v roce 2016) zahrnovala nov\u00e9 rozhran\u00ed REST API, kter\u00e9 bylo zalo\u017een\u00e9 na WordPress JSON API. T\u00edm p\u00e1dem se rozhran\u00ed(nyn\u00ed ozna\u010dovan\u00e9 jako „Legacy“) stalo ji\u017e v t\u00e9 dob\u011b zastaral\u00fdm<\/strong>. Pro spr\u00e1vnou funk\u010dnost je nav\u00edc t\u0159eba jej m\u00edt trvale povolen\u00e9 v administrativn\u00ed oblasti WooCommerce.<\/p>\n\n\n\n

Z t\u011bchto a dal\u0161\u00edch d\u016fvod\u016f je tedy rozhodnuto o tom, \u017ee bude Legacy REST API v nov\u00e9 verzi WooCommerce 9.0 odstran\u011bno<\/strong>. Vyd\u00e1n\u00ed Woo verze 9.0 je napl\u00e1nov\u00e1no ji\u017e na \u010derven 2024<\/strong>. Pokud v\u0161ak z n\u011bjak\u00e9ho d\u016fvodu Legaci st\u00e1le pou\u017e\u00edv\u00e1te, nezoufejte, k dispozici je ji\u017e nov\u011b dostupn\u00e9 samostatn\u00e9 roz\u0161\u00ed\u0159en\u00ed pro Woo, kter\u00e9 bude ve\u0161ker\u00fd odstran\u011bn\u00fd k\u00f3d st\u00e1le obsahovat. <\/p>\n\n\n\n

U verze Woo 9.0 a nov\u011bj\u0161\u00edch verz\u00ed se pro n\u00e1s, ani pro klienty(stejn\u00e9 kl\u00ed\u010de klienta budou nad\u00e1le fungovat) nic nem\u011bn\u00ed, sta\u010d\u00ed m\u00edt pouze nainstalovan\u00e9 a aktivovan\u00e9 nov\u00e9 roz\u0161\u00ed\u0159en\u00ed pro zachov\u00e1n\u00ed zp\u011btn\u00e9 kompatibility. <\/p>\n\n\n\n

Bez aktivovan\u00e9ho roz\u0161\u00ed\u0159en\u00ed nebude <\/strong>mo\u017en\u00e9 pou\u017e\u00edvat ani Wp hooky s Legacym spojen\u00e9.<\/p>\n\n\n\n

Pro\u010d se chyst\u00e1 tato zm\u011bna?<\/h2>\n\n\n\n

D\u016fvodem odstran\u011bn\u00ed Legacy REST API je p\u0159edev\u0161\u00edm v\u011bt\u0161\u00ed p\u0159ehlednost <\/strong>a zdokonalov\u00e1n\u00ed WooCommerce<\/strong> pro u\u017eivatele i v\u00fdvoj\u00e1\u0159e. Ji\u017e del\u0161\u00ed dobu se nedoporu\u010duje Legacy REST API v\u016fbec pou\u017e\u00edvat, proto je tedy zbyte\u010dn\u00e9, aby jej Woo nad\u00e1le obsahoval. <\/p>\n\n\n\n

D\u00edky odstran\u011bn\u00ed nebude v nov\u00e9 verzi WooCommerce tolik zbyte\u010dn\u00fdch dat, co\u017e ve fin\u00e1le m\u016f\u017ee v\u00e9zt k lep\u0161\u00edmu pochopen\u00ed <\/strong>WooCommerce REST API ze strany v\u00fdvoj\u00e1\u0159\u016f.<\/p>\n\n\n\n

Jak zjistit koho se zm\u011bna t\u00fdk\u00e1?<\/h2>\n\n\n\n

Jestli i V\u00e1\u0161 web funkce Legaci pou\u017e\u00edv\u00e1 lze zjistit dv\u011bma zp\u016fsoby:<\/p>\n\n\n\n

1) Legacy je povoleno v nastaven\u00ed Woo<\/h3>\n\n\n\n

D\u00e1 se zkontrolovat velmi snadno. Otev\u0159eme n\u00e1sleduj\u00edc\u00ed polo\u017eku: WooCommerce > Nastaven\u00ed > Pokro\u010dil\u00fd > Legacy API<\/strong>, kde m\u016f\u017eeme vid\u011bt, zda-li je Legacy povolen\u00e9:<\/p>\n\n\n\n

\"\"<\/a><\/figure>\n\n\n\n

2) Na webu jsou nastaven\u00e9 Legacy webhooky<\/h3>\n\n\n\n

V nastaven\u00ed Woo v sekci Webhooky mohou n\u011bkter\u00e9 z nich souviset s Legacy. V p\u0159\u00edpad\u011b, \u017ee pou\u017e\u00edv\u00e1me Woo verzi 8.3 a vy\u0161\u0161\u00ed, m\u016f\u017eeme dnadno vid\u011bt, kolik webhook\u016f Legacy st\u00e1le je\u0161t\u011b pou\u017e\u00edv\u00e1.<\/p>\n\n\n\n

\"\"<\/a><\/figure>\n\n\n\n

Pokud pou\u017e\u00edv\u00e1me Woo verzi 8.2 a ni\u017e\u0161\u00ed, mus\u00edme v\u0161echny aktivn\u00ed webhooky proj\u00edt <\/strong>a zkontrolovat individu\u00e1ln\u011b<\/strong>!<\/p>\n\n\n\n

\"\"<\/a><\/figure>\n\n\n\n

V\u0161ichni, kte\u0159\u00ed cht\u011bj\u00ed pou\u017e\u00edvat Legacy REST API nad\u00e1le, m\u011bli by m\u00edt nainstalovan\u00e9 roz\u0161\u00ed\u0159en\u00ed pro zachov\u00e1n\u00ed spr\u00e1vn\u00e9 funk\u010dnosti je\u0161t\u011b p\u0159ed vyd\u00e1n\u00edm Woo 9.0. <\/p>\n\n\n\n

Od Woo 8.3 by m\u011bly b\u00fdt weby s povolen\u00fdm Legacy, nebo s Legacy webhooky upozorn\u011bny .<\/p>\n\n\n\n

Jak\u00e9 kroky podniknout p\u0159ed vyd\u00e1n\u00edm Woo verze 9.0?<\/h2>\n\n\n\n

Pokud jsme si jisti, \u017ee budeme pot\u0159ebovat m\u00edt Legacy REST API povolen\u00e9 i nad\u00e1le, doporu\u010duji m\u00edt nainstalovan\u00e9 roz\u0161\u00ed\u0159en\u00ed <\/strong>pro podporu star\u00e9ho REST API hned, jakmile to bude mo\u017en\u00e9, a to je\u0161t\u011b p\u0159ed p\u0159echodem na WooCommerce 9.0 a vy\u0161\u0161\u00ed. <\/p>\n\n\n\n

Roz\u0161\u00ed\u0159en\u00ed vy\u0161lo nejprve na GitHubu, a te\u010f je ji\u017e dostupn\u00e9 <\/strong>v samotn\u00e9m repozit\u00e1\u0159 plugin\u016f:<\/p>\n\n\n\n

\n
WooCommerce Legacy REST API<\/a><\/blockquote>