{"id":5149,"date":"2019-01-24T09:30:17","date_gmt":"2019-01-24T09:30:17","guid":{"rendered":"https:\/\/musilda.cz\/?p=5149"},"modified":"2019-01-24T09:30:17","modified_gmt":"2019-01-24T09:30:17","slug":"automaticke-dokonceni-objednavky-u-virtualnich-produktu-ve-woocommerce","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/automaticke-dokonceni-objednavky-u-virtualnich-produktu-ve-woocommerce\/","title":{"rendered":"Automatick\u00e9 dokon\u010den\u00ed objedn\u00e1vky u virtu\u00e1ln\u00edch produkt\u016f ve WooCommerce"},"content":{"rendered":"

Virtu\u00e1ln\u00ed produkty se p\u0159\u00edmo nab\u00edz\u00ed, aby se proces jejich n\u00e1kupu automatizoval. Ne v\u017edy to zd\u00e1nliv\u011b funguje. V \u010dl\u00e1nku najdete vysv\u011btlen\u00ed a jednoduch\u00fd snippet, na obejit\u00ed probl\u00e9mu.<\/p>\n

WooCommerce obsahuje u produkt\u016f nastaven\u00ed, kter\u00e9 z nich ud\u011blaj\u00ed virtu\u00e1ln\u00ed. Tedy takov\u00e9, jen\u017e nepot\u0159ebuj\u00ed dopravu. Virtu\u00e1ln\u00ed produkt m\u016f\u017ee b\u00fdt i e-book, nebo n\u011bjak\u00fd poukaz. Ostatn\u011b, tak se prod\u00e1vaj\u00ed nap\u0159\u00edklad pluginy pro WordPress.<\/p>\n

N\u011bkter\u00e9 platebn\u00ed metody, nebo pluginy, um\u00ed objedn\u00e1vky takov\u00fdch plugin\u016f, ozna\u010dit rovnou jako zaplacen\u00e9 a d\u00edky tomu se d\u00e1 cel\u00fd proces automatizovat. Z\u00e1kazn\u00edk objedn\u00e1, zaplat\u00ed kartou, vystav\u00ed se mu faktura a v\u0161e se mu po\u0161le e-mailem a hotovo.<\/p>\n

Bohu\u017eel, to v\u0161ak funguje jen u produkt\u016f, kter\u00e9 jsou virtu\u00e1ln\u00ed a ke sta\u017een\u00ed. U produkt\u016f, jen\u017e nejsou ke sta\u017een\u00ed, WooCommerce p\u0159edpokl\u00e1d\u00e1, \u017ee bude n\u00e1sledovat je\u0161t\u011b dal\u0161\u00ed procesn\u00ed krok a proto obsahuje p\u0159\u00edznak\u00a0needs_processing. Ten je p\u0159id\u00e1n do objedn\u00e1vky, pokud se nejedn\u00e1 o produkt virtu\u00e1ln\u00ed a ke sta\u017een\u00ed. Z\u00e1rove\u0148 je je ulo\u017een transient do options. To v\u0161e je pak odstran\u011bno, pokud je objedn\u00e1vka ozna\u010dena jako completed.<\/p>\n

Tolik pro vysv\u011btlen\u00ed probl\u00e9mu. V p\u0159\u00edpad\u011b, \u017ee m\u00e1te virtu\u00e1ln\u00ed produkty, jen\u017e nejsou ke sta\u017een\u00ed a chcete tento p\u0159\u00edznak vypnout (u plugin\u016f z Toret.cz je p\u0159\u00edznak needs_processing zohledn\u011bn ), sta\u010d\u00ed pou\u017e\u00edt n\u00e1sleduj\u00edc\u00ed snippet:<\/p>\n

Snippet je jen uk\u00e1zka, ale funkce je vol\u00e1na pro ka\u017ed\u00fd produkt, kter\u00fd je v objedn\u00e1vce a m\u016f\u017eete tak \u0159e\u0161it p\u0159\u00edpadn\u00e9 z\u00e1vislosti. Pokud jej pou\u017eijete tak jak je, ozna\u010d\u00ed v\u0161echny produkty v objedn\u00e1vce, \u017ee nepot\u0159ebuj\u00ed dal\u0161\u00ed proces.<\/p>\n

Chcete se o WooCommerce dozv\u011bd\u011bt v\u00edce? P\u0159ij\u010fte na n\u011bkter\u00e9 ze \u0161kolen\u00ed<\/p>\n

\"\"<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"

Virtu\u00e1ln\u00ed produkty se p\u0159\u00edmo nab\u00edz\u00ed, aby se proces jejich n\u00e1kupu automatizoval. Ne v\u017edy to zd\u00e1nliv\u011b funguje. V \u010dl\u00e1nku najdete vysv\u011btlen\u00ed a jednoduch\u00fd snippet, na obejit\u00ed probl\u00e9mu. WooCommerce obsahuje u produkt\u016f nastaven\u00ed, kter\u00e9 z nich ud\u011blaj\u00ed virtu\u00e1ln\u00ed. Tedy takov\u00e9, jen\u017e nepot\u0159ebuj\u00ed dopravu. Virtu\u00e1ln\u00ed produkt m\u016f\u017ee b\u00fdt i e-book, nebo n\u011bjak\u00fd poukaz. Ostatn\u011b, tak se prod\u00e1vaj\u00ed nap\u0159\u00edklad<\/p>\n","protected":false},"author":1,"featured_media":5150,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[425],"class_list":["post-5149","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-woocommerce","tag-woocommerce"],"_links":{"self":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/5149"}],"collection":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/comments?post=5149"}],"version-history":[{"count":0,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/5149\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media\/5150"}],"wp:attachment":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media?parent=5149"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/categories?post=5149"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/tags?post=5149"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}