Customize the captcha design in your theme
How to customize the captcha in your Shoporama theme with your own HTML and styling, including the available variables and a ready-to-use example.
Shoporama automatically shows a captcha when a visitor submits an email address without being logged in (for example in a contact form or a back-in-stock notification). You can customize how the captcha looks by creating your own template file.
When is the captcha shown?
The captcha is triggered automatically when:
- A visitor submits a form with an email address without being logged in
- The visitor has an empty cart or no cart at all
- The request is missing an HTTP referer (a suspicious submission)
- Someone signs up for a stock notification (out-of-stock signup)
How to create your own captcha

Create the file captcha.html in your theme:
- Smarty 4 themes: templates/captcha.html
- Smarty 2 themes: captcha.html in the theme root
Available variables
| Variable | Description |
|---|---|
| <{$imgstr}> | Base64-encoded PNG image with the captcha code (310×100 px) |
| <{$form}> | Hidden form fields with the original POST data |
| <{$error}> | Set to true if the visitor entered the wrong code |
Example (Smarty 4)
<form action="" method="post">
<{$form}>
<{if $error}>
<p>Wrong code. Please try again.</p>
<{/if}>
<img src="<{$imgstr}>" alt="Captcha">
<input type="text" name="c" autocomplete="off"
maxlength="3" autofocus>
<button type="submit">Confirm</button>
</form>
Important
The input field must have name="c", because this is the field Shoporama validates against. The code is 3 characters long and is validated case-insensitively.
Auto-submit after 3 characters
Most themes submit the form automatically once the visitor has typed 3 characters. You can implement this with the following JavaScript:
document.querySelector('input[name="c"]')
.addEventListener('input', function() {
if (this.value.length === 3) {
this.closest('form').submit();
}
});
You can style the captcha page freely with CSS, as long as the three required elements are included: <{$form}>, the image from <{$imgstr}>, and the input field with name="c".
Need help? Contact us at support@shoporama.dk.
Related articles
Custom CSS: style your store and admin with your own stylesheet
Add custom CSS to your Shoporama store and admin panel to change colors, fonts, and layout or hide elements without editing theme files. You can...
Customize the content of your automatic emails
How to customize the automatic emails your Shoporama store sends: without code under Design > Emails, with subject lines and texts in the store...
Protect your store against spam orders and fraud
Guide to protecting your Shoporama store against spam orders and fraud using the blacklist, order check, captcha, and 3D Secure.
Related features
Full design freedom: your design, your rules
Design your online store freely with full access to HTML, CSS, and templates. Use ready-made themes, the drag-and-drop Page designer, or build from...
Blacklist and fraud prevention
Protect your online store against fraud and spam with Shoporama's blacklist. Block unwanted orders by email, IP address, and phone number.