What
This guide shows how to insert the store finder from a webshop into a website using an iframe so that visitors can access the webshop directly and make purchases. An iframe (inline frame) is an HTML element that can be used to embed external websites or content into an existing website.
Where
Own website. |
The webshop can be integrated into an existing website if required so that users can use it and go to the webshop to make a purchase.
Here is an example of how the store finder could be styled on the website:
The iframe has two tabs:
Delivery
For delivery, the user must enter an address. There are two possible scenarios:
1. If the address matches the delivery area, the user will be navigated to the item list page with the selected delivery address in the webshop.
2. If the address does not match the delivery area, the user will be redirected to the store list page to select the nearest store for pickup.
Pickup
For pickup, the user must select a pickup time. Once selected, the user will be redirected to the item page on which the pickup option is preselected.
In addition, if activated in the administration area, there are the "Login" and "Register" buttons:
1. If the user is not logged in, clicking on these buttons will redirect them to the webshop, where a login/registration dialog will be displayed.
Registration dialog with "Register now and enjoy!":
Login dialog with "Login":
2. If the user is already logged in, they will be redirected to the profile page.
Integration of the webshop via iframe
We provide the required iframe code for the integration:
<iframe id="storefinder" width="100%" height="505px" src="https://{webshopDomain}/standalone_storefinder" style="border: none;"
allow="geolocation; popups; popups-to-escape-sandbox; window-management"
sandbox="allow-same-origin allow-scripts allow-popups allow-modals allow-forms allow-top-navigation allow-top-navigation-by-user-activation"></iframe>
where:
geolocation (geolocalization): enables the iframe to request the user’s location.
popups (popup windows): allows popups not to be blocked by browsers.
popups-to-escape-sandbox (popups outside the sandbox): enables pop-ups to function outside the sandbox, for example, by opening a new window with a different site.
window-management (window management): helps iframe content interact more actively with the browser's windows, including opening, resizing, or closing them.
allow-same-origin (allow same origin): allows the content inside the iframe to access resources from the same origin (domain, protocol, and port) as the parent page.
allow-scripts (allow scripts): allows JavaScript to run inside the iframe.
allow-modals (allow modal windows): allows pop-ups to be opened inside the iframe.
allow-forms (allow forms): allows form submissions to work inside the iframe.
allow-top-navigation (allow navigation to the top level): allows navigation to the parent window/tab. The content inside iframe can change the parent page.
allow-top-navigation-by-user-activation (allow navigation to the top level with user action): the same as "allow-top-navigation", but only if triggered by user’s action.
By default, the iframe has a height of 505px to fit both mobile and desktop screens. However, if you prefer a narrower section for desktop devices, we can provide a custom <style> that should be added to the <head> section of the website.
Ideally, the iframe height can be customized for a better user interface.
<style>
@media screen and (min-width: 904px) {
#storefinder {
height: 340px;
}
}
</style>