Sync Data
Einrichtung eines Datenfeeds #
Hinweis: Dieser Datenfeed von Smartweb/HostedShop ist veraltet. Das bedeutet, dass wir nur eingeschränkten Support dafür anbieten. Wir empfehlen Ihnen dringend, auf den SOAP API-Datenfeed von Smartweb/HostedShop umzusteigen.
Gehen Sie im SmartWeb Admin zu Kontrolpanel->Prisindeks
Erstellen Sie einen neuen Prisindex, indem Sie in der oberen rechten Ecke auf Opret Eget Prisindeks klicken.
Geben Sie ihm den Namen Clerk.
Verwenden Sie den folgenden Code, um den Datenfeed zu erstellen. Dies generiert einen Link mit dem Produktfeed, der im HTML-Annotationen-Importer unter my.clerk.io verwendet werden kann.
In Feed-Startvorlage einfügen #
{* Bildgröße *}
{$imageWidth = 293}
{$imageHeight = 293}
{* Miniaturansicht Größe *}
{$thumbnailWidth = 60}
{$thumbnailHeight = 60}
{* Ist der Preis inklusive MwSt. - über Abfrage festlegen price_including_vat=true/false - Standard: true *}
{$priceIncludingVat = true}
{if isset($smarty.get.price_including_vat)}
{$priceIncludingVat = ($smarty.get.price_including_vat eq "true")}
{/if}
{* Ausverkaufte Produkte einbeziehen - über Abfrage festlegen include_out_of_stock=true/false - Standard: false *}
{$includeOutOfStock = (isset($smarty.get.include_out_of_stock) && $smarty.get.include_out_of_stock eq "true")}
{* Controller instanziieren *}
{controller assign=productController type=product}
{controller assign=brandController type=user}
{controller assign=variantController type=productVariant}
{controller assign=priceController type=productPrice}
{controller assign=cartController type=cart}
{$productPageLink = PageController::link($page.productPageId)}
{* Datum-Variable festlegen (jetzt + 1 Monat im Y-m-d-Format) *}
{assign date {date('Y-m-d', strtotime("+1 months", strtotime("NOW")))}}
{collection controller=productCategory assign=categories}
{$productLink = {page id=$page.productPageId print=Link}}
{function name=renderCategories}
{foreach $items->getData() as $item}
{collection controller=productCategory assign=subCategories parentId=$item->Id}
<span class="clerk-category-info"
data-id="{$item->Id}"
data-name="{$item->Title|unescape:"html"|clearText}"
data-url="/{$productLink}/{$item->Handle}/"
data-subcategories="[{if $subCategories}{foreach $subCategories->getData() as $category}{$category->Id}{if not $category@last}, {/if}{/foreach}{/if}]">
</span>
{call name=renderCategories items=$subCategories}
{/foreach}
{/function}
{call renderCategories items=$categories}
{* Seiten *}
{controller type=page assign=pagecontroller primary=true}
{collection assign=subPagess controller=page parentId=$page.id showInMenuCheck=false visibleCheck=false primary=true }
{function name=renderPages}
{foreach $items->getData() as $Page}
{collection assign=subPagess2 controller=page parentId=$Page->Id showInMenuCheck=false visibleCheck=false primary=true }
{$pageTitle = trim($Page->Title)}
{$link = trim($pagecontroller->link($Page->Id))}
{if $Page->Type == "text" && $Page->Visible == 0 && $Page->ShowInMenu == 0}
<span class="clerk-pages-info"
data-id="{$Page->Id}"
data-type="cms"
data-url="{$Page->Id}"
data-title="{$Page->Title|unescape:"html"|clearText}"
data-text="{$pagecontroller->getText($Page->Id)|unescape:"html"|clearText}">
</span>
<br>
{/if}
{call name=renderPages items=$subPagess2}
{/foreach}
{/function}
{call renderPages items=$subPagess}
In Feed-Elementvorlage einfügen #
{* Bestimmen, ob das Produkt ausverkauft ist *}
{$soldout = ($product->Soldout and !$product->AllowOutOfStockPurchase)}
{if !$soldout || $includeOutOfStock}
{* Varianten des Produkts laden *}
{collection assign=variants controller=$variantController productId=$product->Id variantId=$product->VariantIds}
{assign variants $variants->getData()}
{if $product->Soldout}
{assign stockhtml $productController->getDeliveryTime($product->DeliveryTimeId, false)|escape:'htmlall'}
{else}
{assign stockhtml $productController->getDeliveryTime($product->DeliveryTimeId, true)|escape:'htmlall'}
{/if}
{* Die Marke des Produkts abrufen *}
{entity assign=brand controller=$brandController id=$product->ProducerId}
{* Die Variantentypen des Produkts abrufen *}
{collection assign=variantTypes controller=$variantTypeController productId=$product->Id}
{* Das Bild des Produkts abrufen *}
{*assign productPicture {picturePath productId=$product->Id}*}
{entity assign=image controller=files type=shop productId=$product->Id}
{if $image}
{$crop = "fill"}
{if !empty($template.settings.DESIGN_IMAGE_BACKGROUND_COLOR)}
{$crop = $template.settings.DESIGN_IMAGE_BACKGROUND_COLOR}
{/if}
{$thumbnailPath = $image->thumbnail($thumbnailWidth, $thumbnailHeight, $crop)}
{$imagePath = $image->thumbnail($imageWidth, $imageHeight, $crop)}
{else}
{placeholdImage assign=placeholder width=$thumbnailWidth height=$thumbnailHeight background=$template.settings.DESIGN_IMAGE_BACKGROUND_COLOR color=$template.settings.FONT_COLOR_PRIMARY text=$text.IMAGE_PLACEHOLDER_TEXT}
{$thumbnailPath = $placeholder->getRelativeFile()}
{placeholdImage assign=placeholder width=$imageWidth height=$imageHeight background=$template.settings.DESIGN_IMAGE_BACKGROUND_COLOR color=$template.settings.FONT_COLOR_PRIMARY text=$text.IMAGE_PLACEHOLDER_TEXT}
{$imagePath = $placeholder->getRelativeFile()}
{/if}
{* Die Kurzbeschreibung des Produkts abrufen *}
{*{assign productDescription $productController->getDescriptionShort($product->Id)}*}
{* Wenn leer, die Listenbeschreibung des Produkts abrufen *}
{* {if empty($productDescription)}
{assign productDescription $productController->getDescriptionList($product->Id)}
{/if}
{* Wenn leer, die lange Beschreibung des Produkts abrufen *}
{*{if empty($productDescription)}
{assign productDescription $productController->getDescription($product->Id)}
{/if}*}
{assign productDescription $productController->getDescription($product->Id)}
{* Die Beschreibung auf maximal 5000 Zeichen kürzen *}
{$productDescription = $productDescription|strip_tags|unescape:"html"|trimTo:5000}
{* Die Beschreibung auf maximal 200 Zeichen kürzen *}
{$productEmailDescription = $productDescription|strip_tags|unescape:"html"|trimTo:200}
{* Den Kategorienpfad des Produkts abrufen *}
{assign categoryPathTitle {categoryTitlePath product=$product separator=" > "}}
{* Produktalter von Sekunden in Tage umrechnen *}
{$ageInDays = ($product->Age / 60 / 60 / 24)|string_format:"%.1f"}
<span class="clerk-product-info"
{* Titel *}
data-name="{$product->Title|escape:'html'|clearText}"
{* Link-URI *}
data-url="{itemLink product=$product}"
{* Link-URL ohne Domain*}
{assign productSurl {itemLink product=$product}}
data-urls="{$productSurl|replace:'https://www.grejfreak.dk/':'/'}"
{* Produkt-ID *}
data-id="{$product->Id}"
{* Beschreibung *}
data-description="{$productDescription|clearText}"
{* Beschreibung *}
data-shortdescription="{$productEmailDescription|clearText}"
{* Verwenden Sie SEO-Keywords für zusätzliche durchsuchbare Keywords *}
{*
{assign var="keywords" value="$productController->getTranslation($product->Id, 'seo_keywords')|lower|escape:"htmlall"|clearText"}
{assign var="keyword_list" value=","|explode:$keywords}
data-keywords2 = "{$keyword_list}"*}
data-keywords="{$productController->getTranslation($product->Id, 'seo_keywords')|lower|escape:"htmlall"|clearText}"
{* Bild *}
data-image="{$imagePath|solutionPath}"
{* Miniaturansicht *}
data-thumbnail="{$thumbnailPath|solutionPath}"
{* Artikelnummer *}
data-sku="{$product->ItemNumber|toUTF8}"
{collection assign=productCustomDatas controller=productCustomData productId=$product->Id typeId=14}
{if $productCustomDatas gt 0}
{foreach $productCustomDatas->getData() as $productCustomData}
data-prislabel="{$productCustomData->Title}"
{/foreach}
{/if}
{collection assign=productCustomDatas controller=productCustomData productId=$product->Id typeId=15}
{if $productCustomDatas gt 0}
{foreach $productCustomDatas->getData() as $productCustomData}
data-profitlabel="{$productCustomData->Title}"
{/foreach}
{/if}
{collection assign=productCustomDatas controller=productCustomData productId=$product->Id typeId=12}
{if $productCustomDatas gt 0}
{foreach $productCustomDatas->getData() as $productCustomData}
data-customlabel="{$productCustomData->Title|toUTF8}"
{/foreach}
{/if}
{if !empty($product->Ean)}
{* Ean-Nummer *}
data-ean="{$product->Ean|toUTF8}"
{/if}
{* Die Preisliste des Produkts abrufen *}
{entity assign=priceLine controller=$priceController productId=$product->Id}
{* Den Lagerstatus-Text des Produkts abrufen *}
{$stockStatusText = {stockStatusText product=$product inStockText='auf Lager' notInStockText='nicht auf Lager'}}
{* Überprüfen, ob das Produkt normal oder eine Variante ist *}
{if $product->Type == "normal"}
{if $product->Soldout}
{$type="normaloutstockstatus"}
{* {$deliveryText = "<span><strong>NICHT AUF LAGER</strong><br>Lieferung 3-14 Tage</span>"}*}
{$deliveryText = $stockhtml}
{else}
{$type="normalinstockstatus"}
{*$deliveryText = "<span><strong>AUF LAGER</strong></span> "*}
{$deliveryText = $stockhtml}
{/if}
{/if}
{if $product->Type == "variant"}
{if $product->Soldout}
{$type="variantoutstockstatus"}
{*$deliveryText = "<span><strong>NICHT AUF LAGER</strong><br>Lieferung 3-14 Tage</span>"*}
{$deliveryText = $stockhtml}
{else}
{$type="variantinstockstatus"}
{*$deliveryText = "<p><strong>LAGERSTATUS</strong>WÄHLEN SIE VARIANTE</p>"*}
{$deliveryText = "<p><strong>{$text.VARIATION_STOCK_BOLD_MESSAGE}</strong>{$text.VARIATION_STOCK_NORMAL_MESSAGE}</p>"}
{/if}
{/if}
data-stock-type ="{$type}"
data-deliveryText ="{$deliveryText}"
{* Preise *}
{assign price $priceLine->PriceMinWithVat}
{if !$priceIncludingVat}
{assign price $priceLine->PriceMinWithoutVat}
{/if}
{* Verkaufspreis *}
data-price="{$price}"
{* Verkaufspreis - Formatiert mit sprachspezifischer Währungs-ISO *}
data-pformatted="{$price|formatPrice}"
{if $priceLine->PriceMin !== $priceLine->PriceMax}
data-pricefrom="true"
{/if}
{$onSale = ($priceLine->PriceMinWithVat < $priceLine->FullPriceMinWithVat)}
{* Wenn das Produkt rabattiert ist, setzen wir den normalen Preis als Listenpreis *}
{if $onSale}
{assign listPrice $priceLine->FullPriceMinWithVat}
{if !$priceIncludingVat}
{assign listPrice $priceLine->FullPriceMinWithoutVat}
{/if}
{* Normalpreis *}
data-list-price="{$listPrice}"
{* Normalpreis - Formatiert mit sprachspezifischer Währungs-ISO *}
data-lpformatted="{$listPrice|formatPrice}"
{*Text mit Angebot hinzufügen *}
data-sale-text="Angebot"
{* Prozent hinzufügen, wenn im Angebot *}
{$priceMin = $priceLine->PriceMin}
{$priceFull = $priceLine->FullPriceMin}
{$diffprice = $priceLine-$priceMin}
{$percentChange = (1 - $priceMin / $priceFull) * 100 }
{$percentChange = (int)$percentChange}
data-price-procent="{$percentChange}"
data-price-procent_int="{$percentChange|formatPrice}"
{/if}
data-on-sale="{if $onSale}true{else}false{/if}"
data-in-stock="{if !$soldout}true{else}false{/if}"
data-stock-av="{if $product->Soldout}false{else}true{/if}"
{* Produktalter *}
data-age="{$ageInDays}"
{* Wenn das Produkt neuer als 30 Tage ist, betrachten wir es als neu *}
{if $ageInDays lt 90}
data-new="true"
{/if}
{* Marke *}
{if !empty($brand->Title)}
{$brandLink = "{$productPageLink}?brand={$brand->Id}-{$brand->Title|formatLink}"}
data-brand="{$brand->Title|escape:"html"|clearText}"
data-brand-url="{$brandLink}"
data-brand-id="{$brand->Id}"
{/if}
{* Wenn das Produkt Varianten hat *}
{if $variants}
{*data-variants-sku="[
{foreach $variants as $variant}
{if !empty($variant->ItemNumber)}
'{$variant->ItemNumber}'{if !$variant@last},{/if}
{/if}
{/foreach}
]"*}
{*
data-variants-name="[
{foreach $variants as $variant}
'{assign variantTitle {variantTitle productId=$product->Id variantId=$variant->Id}}{$variantTitle|escape:"htmlall"|clearText}'{if !$variant@last},{/if}
{/foreach}
]"*}
data-variants-ean="[
{foreach $variants as $variant}
'{assign variantTitle {variantTitle productId=$product->Id variantId=$variant->Id}}{if !empty($variant->Ean)}{$variant->Ean|escape:"htmlall"}{/if}'{if !$variant@last},{/if}
{/foreach}
]"
{/if}
{collection assign=productCustomDatas controller=productCustomData productId=$product->Id typeId=11}
{if $productCustomDatas gt 0}
{foreach $productCustomDatas->getData() as $productCustomData}
data-splash="{$productCustomData->Title}"
{/foreach}
{/if}
{* Splash-Array *}
{if $productCustomDatas gt 0}
data-splasharray='[
{foreach $productCustomDatas->getData() as $productCustomData}
"{$productCustomData->Title}"{if !$productCustomData@last},{/if}
{/foreach}
]'
{/if}
{* Splash-Array ohne Dateityp *}
{if $productCustomDatas gt 0}
data-splasharray-simple='[
{foreach $productCustomDatas->getData() as $productCustomData}
{assign splashSimple {$productCustomData->Title|toUTF8|replace:'.svg':''}}
"{$splashSimple}"{if !$productCustomData@last},{/if}
{/foreach}
]'
{/if}
{* Kategorien *}
data-categories="[
{$product->CategoryId}
{if $product->SecondaryCategoryIds}
{foreach $product->SecondaryCategoryIds as $productCategory}
, {$productCategory}
{/foreach}
{/if}
]">
</span>
{/if}
In Feed-Endvorlage einfügen #
{*Pagination hinzufügen*}
{if !isset($smarty.get.length)}
{$length = 50}
{else}
{$length = $smarty.get.length}
{/if}
{if isset($smarty.get.start)}
{$start = $smarty.get.start + $length}
{else}
{$start = 0}
{/if}
{* Überprüfen, ob ausverkaufte Produkte hinzugefügt werden sollen*}
{if isset($smarty.get.include_out_of_stock)}
{$stock = $smarty.get.include_out_of_stock}
{else}
{$stock = "false"}
{/if}
{* Erstellen Sie den nächsten Link, dem der Crawler folgen soll *}
{if $product->Id}
<a href="/framework/priceindex/?index=clerk&start={$start}&length={$length}&include_out_of_stock={$stock}"></a>
{/if}
Speichern Sie den Prisindex.
Anschließend haben Sie einen Link, der ähnlich aussieht:
https://www.mysmartwebshop.com/framework/priceindex/index=Clerk&include_out_of_stock=false
Gehen Sie zu my.clerk.io -> Daten.
Wählen Sie unter Sync-Methode HTML-Anmerkungen und fügen Sie Ihren Link ein.
Stellen Sie dann die Maximalen Anfragen/Sekunde auf 1 ein und wählen Sie die Sprache.

Klicken Sie schließlich auf Einstellungen aktualisieren und dann auf Sync starten.
Versand von Bestelldaten mit einer CSV-Datei #
Da der Smartweb Prisindeks leider keine Verkäufe von Smartweb zulässt, müssen die Bestellhistorien als CSV-Datei exportiert werden, die dann konvertiert und zu Clerk.io. hochgeladen werden kann.
Um diese CSV-Datei herunterzuladen, beginnen Sie mit Anmelden in Ihrem Smartweb-Backend.
Gehen Sie dann zu Export:

Wählen Sie auf der folgenden Seite Bestellungen unter Daten auswählen und wählen Sie CSV-Datei unter Format auswählen, und klicken Sie dann auf Nächste.

Jetzt müssen Sie auswählen, welche Daten in die CSV-Datei aufgenommen werden sollen.
Clerk.io benötigt die folgenden Daten aus den Bestellungen:
Bestell-ID (Standard)
Datum
Produkt-ID
Kunden-E-Mail
Benutzer-ID
All dies kann in den Dropdowns überprüft werden:

Nachdem Sie die Felder überprüft haben, verwenden Sie den Nach Zeitraum Datumsbereichsselector, um die Verkaufsdaten bis zu dem Zeitpunkt einzuschließen, als Sie Ihre ersten Bestellungen hatten, und klicken Sie auf Nächste:

Klicken Sie schließlich auf Herunterladen, um Ihre CSV-Datei zu erhalten:

Da! Sie haben jetzt Ihre Smartweb-Verkaufsdaten als CSV-Datei.
Jetzt müssen Sie nur noch den Support von Clerk.io kontaktieren, um den besten und sichersten Weg zu finden, die Datei in Ihr Konto hochzuladen.
Auswahl der zu importierenden Produkte #
Der Smartweb / Hostedshop-Feed ermöglicht es Ihnen, ausverkaufte Produkte einfach herauszufiltern oder einzuschließen, indem Sie einen einfachen Teil der Feed-URL ändern.
Gehen Sie zu my.clerk.io und wählen Sie Daten-Sync.
Stellen Sie sicher, dass die URL mit &include_out_of_stock=true endet.

Klicken Sie dann auf Einstellungen aktualisieren und Sync starten, um alle Ihre Produkte zu Clerk.io zu laden.

Beim Import aller Produkte, einschließlich der ausverkauften, erhalten Sie das Attribut in_stock, das für alle Produkte verfügbar ist, sodass Sie einige Clerk.io-Elemente filtern können, um diese nicht anzuzeigen.
Diese Seite wurde von einer hilfreichen KI übersetzt, daher kann es zu Sprachfehlern kommen. Vielen Dank für Ihr Verständnis.