Skip to main content
With a direct order, the customer types product numbers and quantities into a form instead of clicking through the catalog. So that their entries aren’t lost when paging and reloading, a JavaScript module stores them in a cookie. This page describes the parameters you use to adapt this module to your form. Guide: Direct order · Reference: WEBSALE JavaScript library

Including the module

The module is named ws-product-reminder-1.7.0.js and requires the jQuery library.
All parameters are optional. Pass only those that differ from the default. The rest of the page is organized by task, not alphabetically, so you can find related parameters together.

The form fields

The module must find these four classes in your form. Without them, it doesn’t recognize the input rows.
Only when the name field has content does the module write the product number and quantity of that row to the cookie. This isn’t a bug but intentional: only what the shop has confirmed as a valid product is saved.So keep the name field in the form, even if you hide it with CSS.

Checking and deleting

checkOnChange saves the customer a click but triggers a server request for each row. For forms with many rows, it’s worth sticking with the bulk check via checkButtonClass instead.

Segmented product number

Many product ranges have product numbers made up of several blocks, for example 123-456-XL. The module can split the input field into three fields for this. All parameters in this group only take effect as long as numberIntoElements is set to true. If you turn off the segmentation, a single input field with the class from productNumberClass remains.
There’s no parameter for the maximum length of the third block. It takes whatever follows the second separator.In the previous documentation, the second and third blocks both have input_number_part1 as their default value. This is a transcription error, corrected here to input_number_part2 and input_number_part3.

Advertising medium code

As of version 1.6.0, the module can separate an advertising medium code from the same text input as the product number.
cookieActionParam was added in version 1.7.0 because multiple OTPX parameters with the same name on one page could lead to errors. If you use more than one direct order form on a page, give each one its own parameter name.

Scroll position

After checking, the page reloads. These three parameters make sure the customer doesn’t lose their place. scrollPosition and reloadInputName are only needed as long as scrollOnReload is enabled.

Callbacks

You can hook in your own functions at three points.

What changed between versions

When you switch to 1.7.0, the default value of productLine changes. If your stylesheet or template uses direct_order_productLine, it no longer takes effect afterward. Either rename the class or set productLine back to the old value.