{"id":6585,"date":"2022-01-08T10:00:00","date_gmt":"2022-01-08T10:00:00","guid":{"rendered":"https:\/\/musilda.cz\/?p=6585"},"modified":"2022-01-08T10:00:00","modified_gmt":"2022-01-08T10:00:00","slug":"pridani-dalsiho-nastaveni-do-defaultniho-e-mailu-ve-woocommerce","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/pridani-dalsiho-nastaveni-do-defaultniho-e-mailu-ve-woocommerce\/","title":{"rendered":"P\u0159id\u00e1n\u00ed dal\u0161\u00edho nastaven\u00ed do defaultn\u00edho e-mailu ve WooCommerce"},"content":{"rendered":"\n

V\u00fdchoz\u00ed nastaven\u00ed pro e-maily n\u00e1m nemus\u00ed zcela vyhovovat, proto\u017ee je pom\u011brn\u011b jednoduch\u00e9. Uk\u00e1\u017eeme si, jak jednodu\u0161e p\u0159idat dal\u0161\u00ed pole do formul\u00e1\u0159e nastaven\u00ed.<\/p>\n\n\n\n

Nastaven\u00ed e-mailu pro stav on-hold vypad\u00e1 takto:<\/p>\n\n\n\n

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

V jednom z p\u0159edchoz\u00edch \u010dl\u00e1nk\u016f jsme si ukazovali, jak upravit \u0161ablonu e-mailu, aby p\u0159i p\u0159ijet\u00ed objedn\u00e1vky, kter\u00e1 m\u00e1 platebn\u00ed metodu Dob\u00edrka, byl zobrazen odli\u0161n\u00fd text. <\/p>\n\n\n\n

My v\u0161ak budeme cht\u00edt, aby m\u011bl spr\u00e1vce e-shopu mo\u017enost tento text nastavit. <\/p>\n\n\n\n

WooCommerce m\u00e1 pro tato nastaven\u00ed dynamick\u00fd filter woocommerce_settings_api_form_fields_“id nastaven\u00ed“.<\/p>\n\n\n\n

V na\u0161em p\u0159\u00edpad\u011b to je woocommerce_settings_api_form_fields_customer_on_hold_order.<\/p>\n\n\n\n

Vytvo\u0159\u00edme si funkci, jen\u017e bude roz\u0161i\u0159ovat formul\u00e1\u0159 nastaven\u00ed.<\/p>\n\n\n\n

add_filter( 'woocommerce_settings_api_form_fields_customer_on_hold_order', 'musilda_add_email_setting_field' );\nfunction musilda_add_email_setting_field( $fields ){\n\n\t$fields['dobirka-info'] = array(\n\t\t'title'         => __( 'Dob\u00edrka info', 'muislda' ),\n\t\t'type'          => 'textarea',\n\t\t'css'         \t=> 'width:400px; height: 75px;',\n\t\t'desc_tip'      => true,\n\t\t'description'   => __( 'Text, kter\u00fd se zobraz\u00ed v e-mailu, pokud byla pou\u017eita platebn\u00ed metoda Dob\u00edrka', 'musilda' ),\n\t\t'default'       => '',\n\t);\n\n\treturn $fields;\n}<\/code><\/pre>\n\n\n\n

V\u00fdsledek:<\/p>\n\n\n\n

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

Jak vid\u00edte, je to pom\u011brn\u011b jednoduch\u00e9. <\/p>\n\n\n\n

Hodnotu nastaven\u00ed pak z\u00edsk\u00e1me z option woocommerce_customer_on_hold_order_settings.<\/p>\n","protected":false},"excerpt":{"rendered":"

V\u00fdchoz\u00ed nastaven\u00ed pro e-maily n\u00e1m nemus\u00ed zcela vyhovovat, proto\u017ee je pom\u011brn\u011b jednoduch\u00e9. Uk\u00e1\u017eeme si, jak jednodu\u0161e p\u0159idat dal\u0161\u00ed pole do formul\u00e1\u0159e nastaven\u00ed. Nastaven\u00ed e-mailu pro stav on-hold vypad\u00e1 takto: V jednom z p\u0159edchoz\u00edch \u010dl\u00e1nk\u016f jsme si ukazovali, jak upravit \u0161ablonu e-mailu, aby p\u0159i p\u0159ijet\u00ed objedn\u00e1vky, kter\u00e1 m\u00e1 platebn\u00ed metodu Dob\u00edrka, byl zobrazen odli\u0161n\u00fd text. My<\/p>\n","protected":false},"author":1,"featured_media":5600,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[],"class_list":["post-6585","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-woocommerce-snippety"],"_links":{"self":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/6585"}],"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=6585"}],"version-history":[{"count":0,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/6585\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media\/5600"}],"wp:attachment":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media?parent=6585"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/categories?post=6585"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/tags?post=6585"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}