{"id":54532,"date":"2017-09-18T18:07:43","date_gmt":"2017-09-18T21:07:43","guid":{"rendered":"https:\/\/wiki.samuelchopard.ch\/library\/replace-empty-price-0-with-a-link-such-as-request-price\/"},"modified":"2019-03-18T14:29:19","modified_gmt":"2019-03-18T13:29:19","slug":"replace-empty-price-0-with-a-link-such-as-request-price","status":"publish","type":"post","link":"https:\/\/samuelchopard.ch\/wiki\/library\/replace-empty-price-0-with-a-link-such-as-request-price\/","title":{"rendered":"Replace empty price (0) with a link such as &#8220;Request price&#8221;"},"content":{"rendered":"<p><!--more--><\/p>\n<p>This script will replace &#8220;0&#8221; (displayed when the price field in a WooCommerce product is left blank) with a custom link.<\/p>\n<p>Add the following code to your theme&#8217;s <em>functions.php<\/em>:<\/p>\n<pre class=\"EnlighterJSRAW\">add_filter('woocommerce_empty_price_html', 'custom_call_for_price');\nfunction custom_call_for_price() {\n     return '&lt;a target=\"_blank\" href=\"URL HERE\"&gt;CAPTION HERE&lt;\/a&gt;';\n}<\/pre>\n<p>Source : unknown<\/p>\n","protected":false},"excerpt":{"rendered":"This script will replace \"0\" (displayed when the price field in a WooCommerce product is left blank) with a custom [...]","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[246],"class_list":["post-54532","post","type-post","status-publish","format-standard","hentry","category-woocommerce","tag-replace"],"_links":{"self":[{"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/posts\/54532","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/comments?post=54532"}],"version-history":[{"count":1,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/posts\/54532\/revisions"}],"predecessor-version":[{"id":54856,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/posts\/54532\/revisions\/54856"}],"wp:attachment":[{"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/media?parent=54532"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/categories?post=54532"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/samuelchopard.ch\/wiki\/wp-json\/wp\/v2\/tags?post=54532"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}