{"id":5902,"date":"2021-04-11T04:25:40","date_gmt":"2021-04-11T04:25:40","guid":{"rendered":"https:\/\/musilda.cz\/?p=5902"},"modified":"2021-04-11T04:25:40","modified_gmt":"2021-04-11T04:25:40","slug":"jak-pridat-text-k-vyberu-dopravy-na-pokladne-woocommerce","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/jak-pridat-text-k-vyberu-dopravy-na-pokladne-woocommerce\/","title":{"rendered":"Jak p\u0159idat text k v\u00fdb\u011bru dopravy na pokladn\u011b WooCommerce"},"content":{"rendered":"\n

V\u00fdb\u011br dopravy v pokladn\u011b b\u00fdv\u00e1 jednou z \u010dasto upravovan\u00fdch \u010d\u00e1st\u00ed. Tento snippet v\u00e1m pom\u016f\u017ee upravit vzhled v\u00fdb\u011bru.<\/p>\n\n\n\n

Jeden m\u016fj z\u00e1kazn\u00edk m\u011bl po\u017eadavek, aby se pod ka\u017edou dopravou, krom\u011b loga dopravce, zobrazovala je\u0161t\u011b informace o p\u0159edpokl\u00e1dan\u00e9m doru\u010den\u00ed. <\/p>\n\n\n\n

WooCommerce na to m\u00e1 akci woocommerce_after_shipping_rate, kter\u00e1 se nach\u00e1z\u00ed za html tagem label a umo\u017en\u00ed v\u00e1m tam vlo\u017eit cokoliv.<\/p>\n\n\n\n

Nejprve v\u00fdsledek:<\/strong><\/p>\n\n\n\n

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

Snippet:<\/strong><\/p>\n\n\n\n

add_action( 'woocommerce_after_shipping_rate', 'action_after_shipping_rate', 20, 2 );\nfunction action_after_shipping_rate ( $method, $index ) {\n    \n    if( 'ceska-posta' === $method->id ) {\n        echo __( '<span class=\"shipping-label-description\" style=\"width:100%;text-align:left;\">Doru\u010den\u00ed obvykle n\u00e1sleduj\u00edc\u00ed pracovn\u00ed den\n        <\/span>', 'theme' );\n    }\n\n}<\/code><\/pre>\n\n\n\n

Akce p\u0159ij\u00edm\u00e1 kompletn\u00ed informace o dopravn\u00ed metod\u011b a podle jej\u00edho id m\u016f\u017eete vytvo\u0159it podm\u00ednky pro zobrazov\u00e1n\u00ed. <\/p>\n\n\n\n

Dal\u0161\u00ed u\u017eite\u010dn\u00e9 snippety najdete na str\u00e1nce U\u017eite\u010dn\u00e9 snippety pro WooCommerce<\/a><\/strong> <\/p>\n","protected":false},"excerpt":{"rendered":"

V\u00fdb\u011br dopravy v pokladn\u011b b\u00fdv\u00e1 jednou z \u010dasto upravovan\u00fdch \u010d\u00e1st\u00ed. Tento snippet v\u00e1m pom\u016f\u017ee upravit vzhled v\u00fdb\u011bru. Jeden m\u016fj z\u00e1kazn\u00edk m\u011bl po\u017eadavek, aby se pod ka\u017edou dopravou, krom\u011b loga dopravce, zobrazovala je\u0161t\u011b informace o p\u0159edpokl\u00e1dan\u00e9m doru\u010den\u00ed. WooCommerce na to m\u00e1 akci woocommerce_after_shipping_rate, kter\u00e1 se nach\u00e1z\u00ed za html tagem label a umo\u017en\u00ed v\u00e1m tam vlo\u017eit cokoliv.<\/p>\n","protected":false},"author":1,"featured_media":5600,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[19,29],"tags":[],"class_list":["post-5902","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-snippety","category-woocommerce-snippety"],"_links":{"self":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/5902"}],"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=5902"}],"version-history":[{"count":0,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/5902\/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=5902"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/categories?post=5902"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/tags?post=5902"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}