Skip to main content

Migrate Geometry Display

Overview of Differences (V2 → V3)

Attributes

V2 AttributeV3 AttributeRequired in V3Description
data-oz-widget--Determined by the custom element used
data-oz-embed--V3 automatically detects custom button implementations
data-oz-codeglobal-idtrueOfficial GTIN/SKU from manufacturer
-variant-idRequired if product feed is activeShop SKU / Article number
data-oz-namenametrueProduct display name
data-oz-imageimagetrueURL to product preview image
data-oz-fullscreen--Not currently supported (work in progress)
data-oz-labels--Will not be added in V3
data-oz-launcher-label-show--Will not be added in V3
data-oz-launcher-label-hide--Will not be added in V3
-workflowfalseOverride API settings
-langfalseOverride API settings (default: user preference)

Migration Steps

Custom Button

V2

<button data-oz-widget="geometries" data-oz-embed="custom" ...>
Show geometries
</button>

V3 – Without Fallback

The class attribute can be any name and serves as a selector for your CSS. It is recommended to use style="visibility: hidden" to prevent the button from flickering on page load.

<sf-geometry-display ...>
<button type="button" style="visibility: hidden" class="custom-btn"></button>
</sf-geometry-display>

V3 – With Fallback

The fallback element is displayed when the widget cannot be shown (e.g., code not available in our database or server issues). Since the custom button is wrapped in a template element, the initial visibility style is no longer necessary.

<sf-geometry-display ...>
<!-- Element shown if the widget cannot be loaded -->
<a href="#">Your fallback element</a>
<!-- The template tag must be the direct parent of the button element -->
<template>
<button type="button" class="custom-btn"></button>
</template>
</sf-geometry-display>

Full Example

V2

<style>
.custom-btn {
...
}
</style>

<button
class="custom-btn"
data-oz-widget="geometries"
data-oz-embed="custom"
data-oz-code="{{ product.ean }}"
data-oz-name="{{ product.title }}"
data-oz-image="{{ product.image.src }}"
>
Show geometries
</button>

V3

<style>
.custom-btn {
...
}
</style>

<sf-geometry-display
name="{{ Product title variable }}"
global-id="{{ GTIN variable }}"
variant-id="{{ Variant-ID variable }}"
image="{{ Product image url }}"
>
<div id="my-geometry-chart">...</div>
<template>
<button type="button" class="custom-btn"></button>
</template>
</sf-geometry-display>