Kiosk Mode
If you are using kiosk mode in your store, you will need a dedicated website page for each location that will be using a kiosk. You will add a Carrot store embed to each of these pages, with some extra parameters:
On this page, add an HTML code block, ensuring you cancel out any padding, margins, etc. The Carrot Store is designed to occupy the full width of the page.
Paste the following into the code block:
<div id="carrot-store">
<div id="carrot-store-root"></div>
</div>
<script> CARROT_API_URL = "<https://api.nevada.getcarrot.io/api/v1>"; CARROT_SPACE_ID = **INSERT_SPACE_ID**;
CARROT_KIOSK_LOCATION_ID= **LOCATION_ID_NUMBER**;
CARROT_KIOSK_BASE_URL= "**KIOSK_PAGE_SLUG**"
</script>
<script src="<https://nevada-store-core.getcarrot.io/carrot.js>"></script>
Replace the following properties :
SPACE_ID> get your company space ID from the Carrot teamLOCATION_ID_NUMBER> get the location IDs for each of your locations from the Carrot teamKIOSK_PAGE_SLUG> this will be the slug you set for the kiosk wordpress page (eg. yourwebsite.com/thisistheslug)
You will also need to
Configure HTML5 Routing
Finish steps 1 and 2, ensuring that you can see your Carrot embedded on the intended page
Make note of the Wordpress page ID for the kiosk page. It’s an integer number you can see in your browser URL when you’re editing the page in WP Admin.
Install Wordpress plugins:
Rewrite Rules Inspector https://wordpress.org/plugins/rewrite-rules-inspector/
Redirection https://redirection.me/
Code Snippets https://wordpress.org/plugins/code-snippets/
[Optional] If you want the homepage to redirect to your store page, open the Redirection plugin (WP Admin “Tools” -> “Redirection”) and add a redirect from
/with the option “ignore slash” to/store/(or whatever slug you picked for the page in step 4)Open the Code Snippets plugin (WP Admin “Code Snippets” and create a new PHP snippet with the following code:
function kiosk_rewrite() { add_rewrite_rule( '^**PAGE_SLUG**/.+', 'index.php?page_id=**PAGE_ID**', 'top' ); } add_action( 'init', 'kiosk_rewrite', 10 );replacing PAGE_ID with your page ID from step 3 and replacing YOUR_SLUG with your slug from step 4. Example:
function kiosk_rewrite() { add_rewrite_rule( '^store/.+', 'index.php?page_id=1127', 'top' ); } add_action( 'init', 'kiosk_rewrite', 10 );Don’t forget to switch PHP Inserter to “ON” at the top right and save your changes.
Go to the Rewrite Rules Inspector plugin (WP Admin “Tools” -> “Rewrite Rules”) and click “Flush Rules”
Flush as many caches as you can find in your Wordpress
Contact us to ensure that the slug for your embedded store page matches what we have configured in our settings (eg.
/store) This is required for the redirection settings to function correctly.
