{"id":1464,"date":"2014-01-25T07:32:02","date_gmt":"2014-01-25T07:32:02","guid":{"rendered":"http:\/\/musilda.cz\/?p=1464"},"modified":"2014-01-25T07:32:02","modified_gmt":"2014-01-25T07:32:02","slug":"jak-zmenit-pridat-do-kosiku-woocommerce","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/jak-zmenit-pridat-do-kosiku-woocommerce\/","title":{"rendered":"Jak zm\u011bnit text p\u0159idat do ko\u0161\u00edku Woocommerce"},"content":{"rendered":"\n

Woccommerce m\u00e1 celou \u0159adu akc\u00ed a filtr\u016f, pomoc\u00ed nich\u017e m\u016f\u017eete pracovat se \u0161ablonou. Dva z nich umo\u017e\u0148uj\u00ed m\u011bnit zn\u011bn\u00ed textu na tla\u010d\u00edtku „P\u0159idat do ko\u0161\u00edku“. Pokud tedy pot\u0159ebujete stejn\u011b jako j\u00e1, zm\u011bnit tento text, sta\u010d\u00ed do functions.php vlo\u017eit dv\u011b jednoduch\u00e9 funkce.<\/p>\n\n\n\n

Nejprve d\u016fvod, pro\u010d tento text vlastn\u011b m\u011bnit. Prod\u00e1v\u00e1te nap\u0159\u00edklad jeden produkt a budete cht\u00edt otestovat konverze p\u0159i zm\u011bn\u011b textu na tla\u010d\u00edtku. Ostatn\u011b u jednoproduktov\u00fdch eshopu je text „Koupit“ vhodn\u011bj\u0161\u00ed, ne\u017e p\u0159idat do ko\u0161\u00edku.<\/p>\n\n\n\n

Takto to vypadalo p\u0159ed \u00fapravou:<\/strong><\/p>\n\n\n\n

\"Argano.cz\"<\/a><\/figure>\n\n\n\n

Do functions.php p\u0159id\u00e1me n\u00e1sleduj\u00edc\u00ed k\u00f3d:<\/p>\n\n\n\n

function my_cart_button_text() {\n    return __('Koupit', 'woocommerce');\n}\nadd_filter('single_add_to_cart_text', 'my_cart_button_text');\n\nfunction my_archive_cart_button_text() {\n    return __( 'Koupit', 'woocommerce' );\n}\nadd_filter( 'add_to_cart_text', 'my_archive_cart_button_text' );\n<\/pre>\n\n\n\n

Ty funkce mus\u00ed b\u00fdt dv\u011b, jedna pro detail produktu a druh\u00e1 pro v\u00fdpis produkt\u016f.<\/p>\n\n\n\n

Po \u00faprav\u011b:<\/strong><\/p>\n\n\n\n

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

Jak m\u016f\u017eete vid\u011bt, text se zm\u011bnil na ten ve funkci. Ur\u010dit\u011b by to cht\u011blo je\u0161t\u011b zm\u011bnit barvu tla\u010d\u00edtka, ale to nesouvis\u00ed se zm\u011bnou textu.<\/p>\n\n\n\n

Mimochodem Argano.cz<\/a> je postaven\u00e9 na Woocommerce.<\/p>\n","protected":false},"excerpt":{"rendered":"

Woccommerce m\u00e1 celou \u0159adu akc\u00ed a filtr\u016f, pomoc\u00ed nich\u017e m\u016f\u017eete pracovat se \u0161ablonou. Dva z nich umo\u017e\u0148uj\u00ed m\u011bnit zn\u011bn\u00ed textu na tla\u010d\u00edtku „P\u0159idat do ko\u0161\u00edku“. Pokud tedy pot\u0159ebujete stejn\u011b jako j\u00e1, zm\u011bnit tento text, sta\u010d\u00ed do functions.php vlo\u017eit dv\u011b jednoduch\u00e9 funkce. Nejprve d\u016fvod, pro\u010d tento text vlastn\u011b m\u011bnit. Prod\u00e1v\u00e1te nap\u0159\u00edklad jeden produkt a budete cht\u00edt<\/p>\n","protected":false},"author":1,"featured_media":8732,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18,25],"tags":[425],"class_list":["post-1464","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-shortcodes","category-woocommerce","tag-woocommerce"],"_links":{"self":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/1464"}],"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=1464"}],"version-history":[{"count":0,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/1464\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media\/8732"}],"wp:attachment":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media?parent=1464"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/categories?post=1464"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/tags?post=1464"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}