{"id":541,"date":"2015-05-05T21:20:28","date_gmt":"2015-05-05T09:20:28","guid":{"rendered":"http:\/\/geektactics.geektamin.com\/?p=541"},"modified":"2024-06-14T09:53:08","modified_gmt":"2024-06-13T21:53:08","slug":"changing-the-default-demo-store-notice-in-woocommerce","status":"publish","type":"post","link":"https:\/\/geektactics.co.nz\/blog\/changing-the-default-demo-store-notice-in-woocommerce\/","title":{"rendered":"Changing the default Demo Store Notice in Woocommerce"},"content":{"rendered":"

Woocommerce has “store notice” functionality\u00a0built in, which enables you to post a message that displays on every page throughout the site.<\/p>\n

Most themes display this message at the very top of the site, like this:<\/p>\n

\"woocommerce_store_notice2\"<\/p>\n

 <\/p>\n

This setting is found in Woocommerce > Settings > General. \u00a0Tick “Store Notice” and then the text box appears to type your store notice. \u00a0Like this:<\/p>\n

\"woocommerce_store_notice\"<\/p>\n

However …<\/h2>\n

What happens if you (or your client, or a site editor) deletes the lovely message you have there and forgets to untick “Enable site-wide store notice text”?<\/p>\n

Something bad … something very bad …<\/p>\n

Woocommerce has a default message that it shows if you tick the box but don’t type any message. \u00a0And that message is …<\/p>\n

This is a demo store for testing purposes \u2014 no orders shall be fulfilled.<\/span><\/strong><\/p><\/blockquote>\n

Yes, that’s right. \u00a0You could build a beautiful ecommerce website, and hand it over to your client. \u00a0They might publish a store-wide notice for a special promotion, and then when they take the notice off, if they leave the checkbox accidentally ticked, their site will tell all visitors that it is just a demo site for testing purposes. \u00a0Now that is sure to kill their\u00a0sales.<\/p>\n

But thankfully, with just a few lines of code added to your functions.php file in your child them, or your custom code plugin, you can change the default message to anything you like.<\/p>\n

Here’s the code:<\/p>\n

function wc_custom_store_notice_updated( $text ) {\r\n\treturn str_replace( 'This is a demo store for testing purposes &mdash; no orders shall be fulfilled.', '<a href=\"\/shop\/on-sale\">Check out our items On Sale<\/a>', $text );\r\n}\r\nadd_filter( 'woocommerce_demo_store', 'wc_custom_store_notice_updated' );\r\n<\/code><\/pre>\n

 <\/p>\n

In this example I am\u00a0replacing the default text with a hyperlink to the page \/shop\/on-sale and the text that says “Check out our items On Sale”. \u00a0You can replace that section with whatever you like.<\/p>\n

Another alternative to achieve the same thing is, if you are already using a localization\/translation plugin, use that to replace the text.\u00a0Personally, I find adding these few lines to functions.php much easier.<\/p>\n","protected":false},"excerpt":{"rendered":"

Woocommerce has “store notice” functionality\u00a0built in, which enables you to post a message that displays on every page throughout the site. Most themes display this message at the very top of the site, like this:   This setting is found in Woocommerce > Settings > General. \u00a0Tick “Store Notice” and then the text box appears […]<\/p>\n","protected":false},"author":5,"featured_media":542,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,14],"tags":[100],"class_list":["post-541","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-web-development","category-wordpress","tag-woocommerce"],"yoast_head":"\nChanging the default Demo Store Notice in Woocommerce - Geektactics<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/geektactics.co.nz\/blog\/changing-the-default-demo-store-notice-in-woocommerce\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Changing the default Demo Store Notice in Woocommerce - Geektactics\" \/>\n<meta property=\"og:description\" content=\"Woocommerce has “store notice” functionality\u00a0built in, which enables you to post a message that displays on every page throughout the site. Most themes display this message at the very top of the site, like this:   This setting is found in Woocommerce > Settings > General. \u00a0Tick “Store Notice” and then the text box appears […]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/geektactics.co.nz\/blog\/changing-the-default-demo-store-notice-in-woocommerce\/\" \/>\n<meta property=\"og:site_name\" content=\"Geektactics\" \/>\n<meta property=\"article:published_time\" content=\"2015-05-05T09:20:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-06-13T21:53:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/geektactics.co.nz\/wp-content\/uploads\/sites\/2\/2015\/05\/woocommerce_store_notice2.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1179\" \/>\n\t<meta property=\"og:image:height\" content=\"634\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Josh Moore\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Josh Moore\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/geektactics.co.nz\/blog\/changing-the-default-demo-store-notice-in-woocommerce\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/geektactics.co.nz\/blog\/changing-the-default-demo-store-notice-in-woocommerce\/\"},\"author\":{\"name\":\"Josh Moore\",\"@id\":\"https:\/\/geektactics.co.nz\/#\/schema\/person\/6bb496f93975e50731c7b169c39bc4ab\"},\"headline\":\"Changing the default Demo Store Notice in Woocommerce\",\"datePublished\":\"2015-05-05T09:20:28+00:00\",\"dateModified\":\"2024-06-13T21:53:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/geektactics.co.nz\/blog\/changing-the-default-demo-store-notice-in-woocommerce\/\"},\"wordCount\":318,\"commentCount\":6,\"publisher\":{\"@id\":\"https:\/\/geektactics.co.nz\/#organization\"},\"image\":{\"@id\":\"https:\/\/geektactics.co.nz\/blog\/changing-the-default-demo-store-notice-in-woocommerce\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/geektactics.co.nz\/wp-content\/uploads\/sites\/2\/2015\/05\/woocommerce_store_notice2.jpg\",\"keywords\":[\"woocommerce\"],\"articleSection\":[\"Web Development\",\"Wordpress\"],\"inLanguage\":\"en-NZ\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/geektactics.co.nz\/blog\/changing-the-default-demo-store-notice-in-woocommerce\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/geektactics.co.nz\/blog\/changing-the-default-demo-store-notice-in-woocommerce\/\",\"url\":\"https:\/\/geektactics.co.nz\/blog\/changing-the-default-demo-store-notice-in-woocommerce\/\",\"name\":\"Changing the default Demo Store Notice in Woocommerce - Geektactics\",\"isPartOf\":{\"@id\":\"https:\/\/geektactics.co.nz\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/geektactics.co.nz\/blog\/changing-the-default-demo-store-notice-in-woocommerce\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/geektactics.co.nz\/blog\/changing-the-default-demo-store-notice-in-woocommerce\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/geektactics.co.nz\/wp-content\/uploads\/sites\/2\/2015\/05\/woocommerce_store_notice2.jpg\",\"datePublished\":\"2015-05-05T09:20:28+00:00\",\"dateModified\":\"2024-06-13T21:53:08+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/geektactics.co.nz\/blog\/changing-the-default-demo-store-notice-in-woocommerce\/#breadcrumb\"},\"inLanguage\":\"en-NZ\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/geektactics.co.nz\/blog\/changing-the-default-demo-store-notice-in-woocommerce\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-NZ\",\"@id\":\"https:\/\/geektactics.co.nz\/blog\/changing-the-default-demo-store-notice-in-woocommerce\/#primaryimage\",\"url\":\"https:\/\/geektactics.co.nz\/wp-content\/uploads\/sites\/2\/2015\/05\/woocommerce_store_notice2.jpg\",\"contentUrl\":\"https:\/\/geektactics.co.nz\/wp-content\/uploads\/sites\/2\/2015\/05\/woocommerce_store_notice2.jpg\",\"width\":1179,\"height\":634},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/geektactics.co.nz\/blog\/changing-the-default-demo-store-notice-in-woocommerce\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/geektactics.co.nz\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Changing the default Demo Store Notice in Woocommerce\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/geektactics.co.nz\/#website\",\"url\":\"https:\/\/geektactics.co.nz\/\",\"name\":\"Geektactics\",\"description\":\"Interesting Stuff for Geeks\",\"publisher\":{\"@id\":\"https:\/\/geektactics.co.nz\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/geektactics.co.nz\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-NZ\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/geektactics.co.nz\/#organization\",\"name\":\"Geektactics\",\"url\":\"https:\/\/geektactics.co.nz\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-NZ\",\"@id\":\"https:\/\/geektactics.co.nz\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/geektactics.co.nz\/wp-content\/uploads\/sites\/2\/2024\/06\/geektactics-logo.png\",\"contentUrl\":\"https:\/\/geektactics.co.nz\/wp-content\/uploads\/sites\/2\/2024\/06\/geektactics-logo.png\",\"width\":2001,\"height\":831,\"caption\":\"Geektactics\"},\"image\":{\"@id\":\"https:\/\/geektactics.co.nz\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/geektactics.co.nz\/#\/schema\/person\/6bb496f93975e50731c7b169c39bc4ab\",\"name\":\"Josh Moore\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-NZ\",\"@id\":\"https:\/\/geektactics.co.nz\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/2bea43488633fc79ace340300f8ab6d6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/2bea43488633fc79ace340300f8ab6d6?s=96&d=mm&r=g\",\"caption\":\"Josh Moore\"},\"description\":\"I love marketing and technology. I run Duoplus Online Marketing and enjoy helping companies grow their income especially through using online marketing effectively.\",\"sameAs\":[\"https:\/\/www.duoplus.nz\"],\"url\":\"https:\/\/geektactics.co.nz\/blog\/author\/josh\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Changing the default Demo Store Notice in Woocommerce - Geektactics","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/geektactics.co.nz\/blog\/changing-the-default-demo-store-notice-in-woocommerce\/","og_locale":"en_US","og_type":"article","og_title":"Changing the default Demo Store Notice in Woocommerce - Geektactics","og_description":"Woocommerce has “store notice” functionality\u00a0built in, which enables you to post a message that displays on every page throughout the site. Most themes display this message at the very top of the site, like this:   This setting is found in Woocommerce > Settings > General. \u00a0Tick “Store Notice” and then the text box appears […]","og_url":"https:\/\/geektactics.co.nz\/blog\/changing-the-default-demo-store-notice-in-woocommerce\/","og_site_name":"Geektactics","article_published_time":"2015-05-05T09:20:28+00:00","article_modified_time":"2024-06-13T21:53:08+00:00","og_image":[{"width":1179,"height":634,"url":"https:\/\/geektactics.co.nz\/wp-content\/uploads\/sites\/2\/2015\/05\/woocommerce_store_notice2.jpg","type":"image\/jpeg"}],"author":"Josh Moore","twitter_misc":{"Written by":"Josh Moore","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/geektactics.co.nz\/blog\/changing-the-default-demo-store-notice-in-woocommerce\/#article","isPartOf":{"@id":"https:\/\/geektactics.co.nz\/blog\/changing-the-default-demo-store-notice-in-woocommerce\/"},"author":{"name":"Josh Moore","@id":"https:\/\/geektactics.co.nz\/#\/schema\/person\/6bb496f93975e50731c7b169c39bc4ab"},"headline":"Changing the default Demo Store Notice in Woocommerce","datePublished":"2015-05-05T09:20:28+00:00","dateModified":"2024-06-13T21:53:08+00:00","mainEntityOfPage":{"@id":"https:\/\/geektactics.co.nz\/blog\/changing-the-default-demo-store-notice-in-woocommerce\/"},"wordCount":318,"commentCount":6,"publisher":{"@id":"https:\/\/geektactics.co.nz\/#organization"},"image":{"@id":"https:\/\/geektactics.co.nz\/blog\/changing-the-default-demo-store-notice-in-woocommerce\/#primaryimage"},"thumbnailUrl":"https:\/\/geektactics.co.nz\/wp-content\/uploads\/sites\/2\/2015\/05\/woocommerce_store_notice2.jpg","keywords":["woocommerce"],"articleSection":["Web Development","Wordpress"],"inLanguage":"en-NZ","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/geektactics.co.nz\/blog\/changing-the-default-demo-store-notice-in-woocommerce\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/geektactics.co.nz\/blog\/changing-the-default-demo-store-notice-in-woocommerce\/","url":"https:\/\/geektactics.co.nz\/blog\/changing-the-default-demo-store-notice-in-woocommerce\/","name":"Changing the default Demo Store Notice in Woocommerce - Geektactics","isPartOf":{"@id":"https:\/\/geektactics.co.nz\/#website"},"primaryImageOfPage":{"@id":"https:\/\/geektactics.co.nz\/blog\/changing-the-default-demo-store-notice-in-woocommerce\/#primaryimage"},"image":{"@id":"https:\/\/geektactics.co.nz\/blog\/changing-the-default-demo-store-notice-in-woocommerce\/#primaryimage"},"thumbnailUrl":"https:\/\/geektactics.co.nz\/wp-content\/uploads\/sites\/2\/2015\/05\/woocommerce_store_notice2.jpg","datePublished":"2015-05-05T09:20:28+00:00","dateModified":"2024-06-13T21:53:08+00:00","breadcrumb":{"@id":"https:\/\/geektactics.co.nz\/blog\/changing-the-default-demo-store-notice-in-woocommerce\/#breadcrumb"},"inLanguage":"en-NZ","potentialAction":[{"@type":"ReadAction","target":["https:\/\/geektactics.co.nz\/blog\/changing-the-default-demo-store-notice-in-woocommerce\/"]}]},{"@type":"ImageObject","inLanguage":"en-NZ","@id":"https:\/\/geektactics.co.nz\/blog\/changing-the-default-demo-store-notice-in-woocommerce\/#primaryimage","url":"https:\/\/geektactics.co.nz\/wp-content\/uploads\/sites\/2\/2015\/05\/woocommerce_store_notice2.jpg","contentUrl":"https:\/\/geektactics.co.nz\/wp-content\/uploads\/sites\/2\/2015\/05\/woocommerce_store_notice2.jpg","width":1179,"height":634},{"@type":"BreadcrumbList","@id":"https:\/\/geektactics.co.nz\/blog\/changing-the-default-demo-store-notice-in-woocommerce\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/geektactics.co.nz\/"},{"@type":"ListItem","position":2,"name":"Changing the default Demo Store Notice in Woocommerce"}]},{"@type":"WebSite","@id":"https:\/\/geektactics.co.nz\/#website","url":"https:\/\/geektactics.co.nz\/","name":"Geektactics","description":"Interesting Stuff for Geeks","publisher":{"@id":"https:\/\/geektactics.co.nz\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/geektactics.co.nz\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-NZ"},{"@type":"Organization","@id":"https:\/\/geektactics.co.nz\/#organization","name":"Geektactics","url":"https:\/\/geektactics.co.nz\/","logo":{"@type":"ImageObject","inLanguage":"en-NZ","@id":"https:\/\/geektactics.co.nz\/#\/schema\/logo\/image\/","url":"https:\/\/geektactics.co.nz\/wp-content\/uploads\/sites\/2\/2024\/06\/geektactics-logo.png","contentUrl":"https:\/\/geektactics.co.nz\/wp-content\/uploads\/sites\/2\/2024\/06\/geektactics-logo.png","width":2001,"height":831,"caption":"Geektactics"},"image":{"@id":"https:\/\/geektactics.co.nz\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/geektactics.co.nz\/#\/schema\/person\/6bb496f93975e50731c7b169c39bc4ab","name":"Josh Moore","image":{"@type":"ImageObject","inLanguage":"en-NZ","@id":"https:\/\/geektactics.co.nz\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/2bea43488633fc79ace340300f8ab6d6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2bea43488633fc79ace340300f8ab6d6?s=96&d=mm&r=g","caption":"Josh Moore"},"description":"I love marketing and technology. I run Duoplus Online Marketing and enjoy helping companies grow their income especially through using online marketing effectively.","sameAs":["https:\/\/www.duoplus.nz"],"url":"https:\/\/geektactics.co.nz\/blog\/author\/josh\/"}]}},"_links":{"self":[{"href":"https:\/\/geektactics.co.nz\/wp-json\/wp\/v2\/posts\/541"}],"collection":[{"href":"https:\/\/geektactics.co.nz\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/geektactics.co.nz\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/geektactics.co.nz\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/geektactics.co.nz\/wp-json\/wp\/v2\/comments?post=541"}],"version-history":[{"count":5,"href":"https:\/\/geektactics.co.nz\/wp-json\/wp\/v2\/posts\/541\/revisions"}],"predecessor-version":[{"id":557,"href":"https:\/\/geektactics.co.nz\/wp-json\/wp\/v2\/posts\/541\/revisions\/557"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/geektactics.co.nz\/wp-json\/wp\/v2\/media\/542"}],"wp:attachment":[{"href":"https:\/\/geektactics.co.nz\/wp-json\/wp\/v2\/media?parent=541"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/geektactics.co.nz\/wp-json\/wp\/v2\/categories?post=541"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/geektactics.co.nz\/wp-json\/wp\/v2\/tags?post=541"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}