{"id":60,"date":"2020-11-18T17:35:35","date_gmt":"2020-11-18T17:35:35","guid":{"rendered":"https:\/\/theatlass.com\/help\/?post_type=docs&#038;p=60"},"modified":"2020-12-01T15:40:42","modified_gmt":"2020-12-01T15:40:42","slug":"install-the-script-on-custom-store","status":"publish","type":"docs","link":"https:\/\/theatlass.com\/resources\/docs\/install-the-script-on-custom-store\/","title":{"rendered":"Install the script on custom store"},"content":{"rendered":"\n<p>Create an if statement for logged in users vs logged out users.<\/p>\n\n\n\n<p>For logged out users, aka visitors, use the code below:<\/p>\n\n\n\n<p>Copy the script below and paste it as high as you can within the HEAD tag ( <code>&lt;head&gt;&lt;\/head&gt;<\/code> ).<\/p>\n\n\n<div class=\"wp-block-lazyblock-tracking-script lazyblock-tracking-script-Z1fv89s\"><div class=\"alert alert-dark\" role=\"alert\"> Please log in from <a href=\"https:\/\/theatlass.com\/app\/\" target=\"_blank\" >here<\/a> in order to get the code <\/div><\/div>\n\n\n<p>For logged in users, use the code below:<\/p>\n\n\n\n<p>Copy the script below and paste it as high as you can within the HEAD tag ( <code>&lt;head&gt;&lt;\/head&gt;<\/code> ).<\/p>\n\n\n<div class=\"wp-block-lazyblock-tracking-script lazyblock-tracking-script-Z2mQJn1\"><div class=\"alert alert-dark\" role=\"alert\"> Please log in from <a href=\"https:\/\/theatlass.com\/app\/\" target=\"_blank\" >here<\/a> in order to get the code <\/div><\/div>\n\n\n<p>Don&#8217;t forget to save the file.<\/p>\n\n\n\n<p>For example, the full code for a store built with PHP would look like:<\/p>\n\n\n<div class=\"wp-block-lazyblock-script-code-block lazyblock-script-code-block-Z688vo\"><div class=\"code-block w-100\" >\n<pre class=\"wp-block-code\" id=\"custom-php-store\" >\n  &lt;?php if ( user_loggedin() ) { ?&gt;\n          \t &lt;script&gt;\n                  window.atlassSettings = {\n                      APPKEY: \"_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_\",\n                      tags: 'primary',\n                      email: '<?php print $loggedin_user_email; ?>'\n                  }\n                  var s = document.createElement(\"script\");\n                  s.type = \"text\/javascript\";\n                  s.src = \"https:\/\/theatlass.com\/t\/t.min.js\";\t\n                  document.head.appendChild(s);\n              &lt;\/script&gt;\n          &lt;?php } else { ?&gt;\n          \t &lt;script&gt;\n                  window.atlassSettings = {\n                      APPKEY: \"_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_\",\n                      tags: 'primary',\n                  }\n                  var s = document.createElement(\"script\");\n                  s.type = \"text\/javascript\";\n                  s.src = \"https:\/\/theatlass.com\/t\/t.min.js\";\n                  document.head.appendChild(s);\n              &lt;\/script&gt;\n          &lt;?php } ?&gt;<\/pre>\n<a data-copy=\"custom-php-store\" class=\"btn-copy-script\"> <i class=\"far fa-copy\"><\/i>  <\/a>\n<\/div>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Create an if statement for logged in users vs logged out users. For logged out users, aka visitors, use the code below: Copy the script below and paste it as high as you can within the HEAD tag ( &lt;head&gt;&lt;\/head&gt; ). For logged in users, use the code below: Copy the script below and paste [&hellip;]<\/p>\n","protected":false},"featured_media":0,"menu_order":5,"template":"","meta":[],"_links":{"self":[{"href":"https:\/\/theatlass.com\/resources\/wp-json\/wp\/v2\/docs\/60"}],"collection":[{"href":"https:\/\/theatlass.com\/resources\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/theatlass.com\/resources\/wp-json\/wp\/v2\/types\/docs"}],"wp:attachment":[{"href":"https:\/\/theatlass.com\/resources\/wp-json\/wp\/v2\/media?parent=60"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}