Emergency

In urgent situations or outages, you can send a text message to our emergency line

Emergency line (text message only)

+45 29 70 15 95

Send a text message with the following information:

  • Your name and webshop
  • A description of the problem

Note: This service is only for critical situations where your webshop is down or has serious problems. For regular support, please use our normal support channels.

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.

Reading time: about 4 minutes
Developer

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

The Shoporama code editor under Design with the file list for the MBN-Delaware theme, where captcha.html and the other template files are edited directly in the browser.
The code editor in the Shoporama admin under Design, with the theme's files in the left column. This is where you create and edit captcha.html along with the other template files.

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.