Skip to main content
A product configurator, a page-flip catalog, articles from an editorial system: content like this lives outside the shop but should look as if it belongs there. The usual route via a link takes the visitor out of the shop, and frames and popups come with their own drawbacks. WEBSALE V8s offers two methods for this, and the choice between them decides more than just the effort involved. For content that rarely changes, the second route is the better one. For anything that has to be calculated at the moment of the request, only the first remains.

External includes

The two tags

Two tags embed the output of a third-party program at the position where they are placed. The difference lies in what the shop sends along. With WS-ExternInclude(), all existing GET and POST parameters are combined and passed in the parameters getbuf and postbuf. Form data from a form in the shop is additionally sent to the third-party program via POST. The output of the third-party program may itself contain WEBSALE tags. This lets you display shop data within third-party content.

Specifying the address

The argument holds the address of the third-party program. Both tags support tag-in-tag, so the value of another tag can be part of the address. The tilde characters of the inner tag are replaced by dollar signs.
In the second case, the shop additionally passes the same two parameters URL-encoded in the getbuf parameter:
The shop establishes the connection to the third-party system on the server side, via a proxy. The visitor’s browser sees none of this and does not call the third-party address itself.
Reference: WS-ExternInclude() · WS-URLInclude()

Checking whether the third-party system responds

If the third-party system fails, nothing appears in its place in the shop, and page rendering is delayed until the timeout. The LiveCheck checks in advance whether the system is reachable and lets you respond, for example with substitute content.

Setup

The checks are defined in the <ExternSystemLiveChecks> section of shop.config, with one <+Entry> per check. Up to ten checks are possible.
Reference: ExternSystemLiveChecks section

The check file on the third-party server

For a check of type 1, the response OK counts as success. Any other response and any missing response counts as failure.
For a more meaningful check, add your own checks at this point, for example for the availability of a database.

Querying in the template

Points to note

The time span in Timeout is a trade-off. Too short, and the check fails even though the system is running. Too long, and every outage of the third-party system paralyzes page rendering for all visitors.
To keep the impact of an outage small, wrap the area containing the external include in an AJAX section. The content is then only fetched when the visitor requests it, not on every page view.
Reference: WS-ExternSystemLiveCheck() Guide: How WEBSALE AJAX integrations work · Disabling the internal WEBSALE search when using external search providers

Passing address data to a third-party system

If the third-party system needs the billing or delivery address, special tags pass it in the address of the call. A parameter determines how the data is protected.

Defining the encoding

The password must be exactly 16 characters long. With any other length, the encryption does not take effect, and the data goes out merely hex-encoded.

The tags

The receiving system determines which parameter names are to be used.

The data format

The data is generated in XML format, with the field number forming the element name:
Only what is actually configured in shop.config for the respective address is passed. A field that the shop does not collect does not appear in the transfer.
The fields for the billing and delivery address largely overlap:
The PO box has number 21 in the billing address and number 20 in the delivery address. If you evaluate the fields by number in the receiving system, you must distinguish between both cases.
There are two fields for customer-specific data:

Connecting an editorial system

This chapter is being revised. If you have any questions, please contact your WEBSALE contact person.
For content from an editorial system, the two routes mentioned at the beginning are available. The decision depends on whether the content includes active features.
We advise against integration via ExternInclude. The display then permanently depends on the availability of the third-party system, and the loading times no longer meet current technical standards.
Any editorial system that can export in JSON format can be connected.

How it works

The editorial system stores two kinds of files in the shop’s FTP area: one JSON file per content page, plus a mapping file that assigns each address its file. The addresses of the content pages contain a common directory, for example /cms/. This directory is the trigger: A server rule recognizes addresses that start with it and redirects them in the background to a shop template. The originally requested address is passed as a one-time parameter, and this is exactly how the template knows which JSON file to load.
The address visible in the browser does not change.

Step 1: Activation and FTP access

Have the JSON interface activated. You will receive a separate FTP account for the files from the editorial system. The address rule must also be set up by WEBSALE system administration. Three settings are part of this setup. WEBSALE uses default values for them; let us know of any different requirements during setup:
If you already use OTP1 for something else, specify a different parameter during setup. Otherwise the two uses will overwrite each other.

Step 2: Exporting content

One JSON file is created per content page and uploaded to the interface’s FTP directory.

Step 3: Exporting the mapping file

The mapping file links address and file.

Step 4: Creating the template

A single template is sufficient for all content pages, because the one-time parameter and the mapping file take over the control. First, the mapping file is loaded and the requested address is searched for in it:
The loop runs through all entries of the mapping file, compares the address with the one-time parameter and, if there is a match, stores the file name in the free placeholder DC-FPjsonData. This file is then loaded and read. The following example sets the values for the head section of the page:
This results in:
The {DC-FPjsonData} wrapper checks whether a file was found at all. Without it, the template tries to load a file without a name.
Reference: EJD tags for the JSON interface Guide: JSON interface
  • Guide: JSON interface
  • Guide: How WEBSALE AJAX integrations work
  • Guide: Exchanging data with external systems