{"id":2307,"date":"2015-01-11T06:49:23","date_gmt":"2015-01-11T06:49:23","guid":{"rendered":"http:\/\/musilda.cz\/?p=2307"},"modified":"2015-01-11T06:49:23","modified_gmt":"2015-01-11T06:49:23","slug":"zobrazeni-ceny-pouze-pro-prihlasene-uzivatele-ve-woocommerce","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/zobrazeni-ceny-pouze-pro-prihlasene-uzivatele-ve-woocommerce\/","title":{"rendered":"Zobrazen\u00ed ceny pouze pro p\u0159ihl\u00e1\u0161en\u00e9 u\u017eivatele ve WooCommerce"},"content":{"rendered":"\n

P\u016fvodn\u011b jsem cht\u011bl tento snippet vlo\u017eit jako odpov\u011b\u010f do jednoho koment\u00e1\u0159e, ale to se mi nepovedlo korektn\u011b. Proto dnes jednoduch\u00e1 funkce, kter\u00e1 obraz\u00ed pro nep\u0159ihl\u00e1\u0161en\u00e9 u\u017eivatele textovou informaci.<\/p>\n\n\n\n\n\n\n\n

Snippet vyu\u017e\u00edv\u00e1 woocommerce_get_html_price, kter\u00fd se d\u00e1 vyu\u017e\u00edt k zaj\u00edmav\u00fdm v\u011bcem, jako je nap\u0159\u00edklad zobrazen\u00ed ceny pouze pro p\u0159ihl\u00e1\u0161en\u00e9 u\u017eivatele. V\u00fdborn\u00e9, pokud vytv\u00e1\u0159\u00edte klubov\u00fd eshop.<\/p>\n\n\n\n

Sta\u010d\u00ed pou\u017e\u00edt tuto funkci:<\/p>\n\n\n\n

add_filter('woocommerce_get_price_html','members_only_price');\n function members_only_price($price){\n   if(is_user_logged_in() ){\n    return $price;\n   }\n   else{\n     return 'Login<\/a> or Register<\/a> to see price!';\n   }\n}\n<\/pre>\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":"

P\u016fvodn\u011b jsem cht\u011bl tento snippet vlo\u017eit jako odpov\u011b\u010f do jednoho koment\u00e1\u0159e, ale to se mi nepovedlo korektn\u011b. Proto dnes jednoduch\u00e1 funkce, kter\u00e1 obraz\u00ed pro nep\u0159ihl\u00e1\u0161en\u00e9 u\u017eivatele textovou informaci.<\/p>\n","protected":false},"author":1,"featured_media":8732,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,25,29],"tags":[],"class_list":["post-2307","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-snippety","category-woocommerce","category-woocommerce-snippety"],"_links":{"self":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/2307"}],"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=2307"}],"version-history":[{"count":0,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/2307\/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=2307"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/categories?post=2307"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/tags?post=2307"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}