{"id":6556,"date":"2022-01-02T10:52:00","date_gmt":"2022-01-02T10:52:00","guid":{"rendered":"https:\/\/musilda.cz\/?p=6556"},"modified":"2022-01-02T10:52:00","modified_gmt":"2022-01-02T10:52:00","slug":"zmena-textu-e-mailu-dle-pouzite-platebni-metody","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/zmena-textu-e-mailu-dle-pouzite-platebni-metody\/","title":{"rendered":"Zm\u011bna textu e-mailu dle pou\u017eit\u00e9 platebn\u00ed metody"},"content":{"rendered":"\n

Univerz\u00e1ln\u00ed text v e-mailu po p\u0159ijet\u00ed platby, nen\u00ed v\u017edy vhodn\u011b formulov\u00e1n, proto\u017ee je obecn\u00fd. Probl\u00e9m vznik\u00e1 tehdy, pokud pou\u017eijete platebn\u00ed metodu, jen\u017e funk\u010dn\u011b neodpov\u00edd\u00e1 textu.<\/p>\n\n\n\n

Text po p\u0159ijet\u00ed objedn\u00e1vky a uveden\u00ed stavu objedn\u00e1vku do stavu on-hold (\u010dek\u00e1 na vy\u0159\u00edzen\u00ed), vypad\u00e1 takto:<\/p>\n\n\n\n

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

Co\u017e odpov\u00edd\u00e1 platb\u011b bankovn\u00edm p\u0159evodem. <\/p>\n\n\n\n

Pokud vyu\u017eijete platbu dob\u00edrkou, u\u017e obsah e-mailu p\u0159est\u00e1v\u00e1 d\u00e1vat smysl, proto\u017ee nejprve odes\u00edl\u00e1te zbo\u017e\u00ed a platbu p\u0159ij\u00edm\u00e1te a\u017e pot\u00e9. <\/p>\n\n\n\n

Zm\u011bna textu o p\u0159ijat\u00e9 objedn\u00e1vce<\/h2>\n\n\n\n

V\u011bt\u0161ina k\u00f3du, kter\u00fd jsem p\u0159id\u00e1v\u00e1m obsahuje n\u011bjakou akci, nebo filter, proto\u017ee nerad upravuji p\u0159\u00edmo soubory \u0161ablon WooCommerce, ale zde to jinak nejde. K\u00f3d toti\u017e vypad\u00e1 takto:<\/p>\n\n\n\n

<p><?php printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ); ?><\/p>\n<p><?php esc_html_e( 'Thanks for your order. It\u2019s on-hold until we confirm that payment has been received. In the meantime, here\u2019s a reminder of what you ordered:', 'woocommerce' ); ?><\/p><\/code><\/pre>\n\n\n\n

Nikde \u017e\u00e1dn\u00fd filter, nebo akce pro ovlivn\u011bn\u00ed chov\u00e1n\u00ed. Tak\u017ee mus\u00edme vz\u00edt soubor customer-on-hold-email.php a zkop\u00edrovat ho do slo\u017eky aktivni-sablona\/woocommerce\/emails\/.<\/p>\n\n\n\n

Jestli\u017ee \u017e\u00e1dnou takovou slo\u017eku v \u0161ablon\u011b nem\u00e1te, mus\u00edte ji vytvo\u0159it. <\/p>\n\n\n\n

N\u00e1sledn\u011b \u0159\u00e1dek s pod\u011bkov\u00e1n\u00ed nahrad\u00edme n\u00e1sleduj\u00edc\u00edm k\u00f3dem?<\/p>\n\n\n\n

if ( 'dobirka' === $order->get_payment_method() ) {\n\techo '<p>' . esc_html__( 'D\u011bkujeme za objedn\u00e1vku, kterou jsme p\u0159ijali a p\u0159ipravujeme ji na odesl\u00e1n\u00ed. Platbu provedete po p\u0159ijet\u00ed zbo\u017e\u00ed. Zde je p\u0159ehled toho co jste si objednali:', 'woocommerce' ) . '<\/p>';\n} else {\n\techo '<p>' . esc_html__( 'Thanks for your order. It\u2019s on-hold until we confirm that payment has been received. In the meantime, here\u2019s a reminder of what you ordered:', 'woocommerce' ) . '<\/p>';\n}<\/code><\/pre>\n\n\n\n

Z objektu objedn\u00e1vky jsme z\u00edskali id platebn\u00ed metody a napsali podm\u00ednku pro dob\u00edrku. Pokud bude zaplaceno jinak, bude pou\u017eit p\u016fvodn\u00ed text. Podm\u00ednku si m\u016f\u017eete upravit podle toho, jak\u00fd text chcete m\u00edt pro konkr\u00e9tn\u00ed platebn\u00ed metodu.<\/p>\n","protected":false},"excerpt":{"rendered":"

Univerz\u00e1ln\u00ed text v e-mailu po p\u0159ijet\u00ed platby, nen\u00ed v\u017edy vhodn\u011b formulov\u00e1n, proto\u017ee je obecn\u00fd. Probl\u00e9m vznik\u00e1 tehdy, pokud pou\u017eijete platebn\u00ed metodu, jen\u017e funk\u010dn\u011b neodpov\u00edd\u00e1 textu. Text po p\u0159ijet\u00ed objedn\u00e1vky a uveden\u00ed stavu objedn\u00e1vku do stavu on-hold (\u010dek\u00e1 na vy\u0159\u00edzen\u00ed), vypad\u00e1 takto: Co\u017e odpov\u00edd\u00e1 platb\u011b bankovn\u00edm p\u0159evodem. Pokud vyu\u017eijete platbu dob\u00edrkou, u\u017e obsah e-mailu p\u0159est\u00e1v\u00e1 d\u00e1vat<\/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-6556","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\/6556"}],"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=6556"}],"version-history":[{"count":0,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/6556\/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=6556"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/categories?post=6556"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/tags?post=6556"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}