To customize orders at store interfaces (so-called store importers), you can modify the transmitted shopping carts (usually called "shopping cart" or "cart") before the final import in xentral.
Depending on the store, the data structure of the shopping cart differs in form and content. Plugins extend this structure additionally. However, the importer only accepts the data that can be interpreted. Therefore, additionally transmitted data must be transferred via Smarty from the shopping cart of the store to the order in xentral. You access the data via the $cart object.
Note
To check which data is available, you can set the filter "Show orders" under the tab "Interface". This way you can see all already processed orders including the received data.
You can find the template editor in all store interfaces under the "Smarty" tab.
On the right side in the "Settings" section you can enable the following options:
-
Transform shopping cart active → Turn Smarty transformation on and off for all orders received after saving. Orders that have already been processed will not be transformed
-
Replace shopping cart → Displays only the result of the template and omits all other shopping cart information. This is useful for testing or when the template considers all possible options
When importing a shopping cart in the store importer, the following sequence is followed:
The order data comes from the (1) store and is processed by the (2) store importer. In the process, an xentral-internal shopping cart structure is created, which can then be processed with (3) Smarty based on the incoming shopping cart data from the store and the already interpreted data of the xentral shopping cart. The target format is a (4) xentral-internal shopping cart structure.
The shopping cart contains the order information (also header information) such as billing and shipping address of the recipient, date and order number from the store, information about shipping method and selected payment method, etc. The formats and contents may differ from store to store.
Links to existing data are created from the header data, e.g. if the e-mail address of an existing customer has been recognized, the order is assigned to the same customer. Otherwise, a new address is created for the customer. Depending on the setting, master data can also be overwritten and thus updated.
Note
The storage of master data already happens before processing by the Smarty Template Engine. Therefore, changes to address data are not taken into account when saving / updating address data!
Here you will find some tips, tricks and hints that may help you.
You can delete unwanted values in the shopping cart by overwriting them with empty nodes. Please note: This function should always be tested in advance, because e.g. master data can be saved before processing with Smarty.
Note
Also when using a foreach loop, contents of XML nodes can be overwritten with the last value of the output. Please note that the last entry of each node is the only remaining one.
To customize order properties, you can also manipulate the following values:
-
Shipment type: <delivery>Shipment type</delivery>
-
Project: <project>project ID</project>
When using Smarty in the store interface, you can only use data from the shopping cart. SQL queries are not possible here.
If hooks affect the creation of orders, they may be applied after the template has been processed.
Output in "Show orders": Preceded by the XML structure of the shopping cart receipt, which is transferred from the store (without Smarty). Subsequently, the shopping cart modified by a template as a result.
Array with numeric indices: [0] is addressed with ->item0. However, array contents can be transferred from the store in different order, so it is always safer to determine the value via a loop with checking the index.
Further hints and functions like escaping with CDATA can be found at Smarty introduction.
A complete list of the available fields including a translation of the field names and a description of the contents in English are linked below each screenshot.
You can find more field definitions here.
You can find more field definitions here.
Below you can find the default templates for the respective store.
In the following code snippet you can find the default template for Shopify.
<?xml version="1.0" encoding="UTF-8"?><xml> {*START PREPARING*} {assign var=orderData value=$cart->orderData} {assign var=transactionNumber1 value=$orderData->token} {assign var=transactionNumber2 value=$orderData->transactions->token} {assign var=timeStamp value=$orderData->created_at|truncate:20:" "} {*PREPARE BILLING ADDRESS*} {assign var=billingAddressFirstName value=$orderData->billing_address->first_name} {assign var=billingAddressLastName value=$orderData->billing_address->last_name} {assign var=billingAddressName value="$billingAddressFirstName $billingAddressLastName"} {assign var=billingAddress1 value=$orderData->billing_address->address1} {assign var=billingAddress2 value=$orderData->billing_address->address2} {if $billingAddress2} {assign var=billingAddress value="$billingAddress1 $billingAddress2"} {else} {assign var=billingAddress value="$billingAddress1"} {/if} {*PREPARE SHIPPING ADDRESS*} {assign var=shippingAddressFirstName value=$orderData->shipping_address->first_name} {assign var=shippingAddressLastName value=$orderData->shipping_address->last_name} {assign var=shippingAddressName value="$shippingAddressFirstName $shippingAddressLastName"} {assign var=shippingAddress1 value=$orderData->shipping_address->address1} {assign var=shippingAddress2 value=$orderData->shipping_address->address2} {if $shippingAddress2 != ""} {assign var=shippingAddress value="$shippingAddress1 $shippingAddress2"} {else} {assign var=shippingAddress value="$shippingAddress1"} {/if} {*END PREPARING*} {*START FILLING THE CART*} <auftrag><![CDATA[{$orderData->id}]]></auftrag> <onlinebestellnummer><![CDATA[{$orderData->order_number}]]></onlinebestellnummer> {if $transactionNumber2 != ""} <transaktionsnummer><![CDATA[{$transactionNumber2}]]></transaktionsnummer> {else} <transaktionsnummer><![CDATA[{$transactionNumber1}]]></transaktionsnummer> {/if} <gesamtsumme><![CDATA[{$orderData->total_price}]]></gesamtsumme> <zahlungsweise><![CDATA[{$orderData->gateway}]]></zahlungsweise> <waehrung><![CDATA[{$orderData->currency}]]></waehrung> <bestelldatum><![CDATA[{$timeStamp|truncate:10:""}]]></bestelldatum> <zeitstempel><![CDATA[{$timeStamp|replace:"T":" "}]]></zeitstempel> {foreach key=key item=item from=$orderData->shipping_lines} <versandkostenbrutto><![CDATA[{$item->price}]]></versandkostenbrutto> {/foreach} {foreach key=noteKey item=note from=$orderData->note_attributes} {if $note->name == "vat_id"} <ustid>$note->value}]]></ustid> {/if} {/foreach} {if $orderData->taxes_included == 1} <rabattbrutto><![CDATA[{$orderData->total_discounts}]]></rabattbrutto> {else} <rabattnetto><![CDATA[{$orderData->total_discounts}]]></rabattnetto> {/if} {*ADDRESS LOGIC*} <anrede>herr</anrede> {if $orderData->billing_address->company != ""} <anrede>firma</anrede> <name><![CDATA[{$orderData->billing_address->company}]]></name> <ansprechpartner><![CDATA[{$billingAddressName}]]></ansprechpartner> {else} <name><![CDATA[{$billingAddressName}]]></name> {/if} <strasse><![CDATA[{$billingAddress}]]></strasse> <plz><![CDATA[{$orderData->billing_address->zip}]]></plz> <ort><![CDATA[{$orderData->billing_address->city}]]></ort> <land><![CDATA[{$orderData->billing_address->country_code}]]></land> <email><![CDATA[{$orderData->contact_email}]]></email> <telefon><![CDATA[{$orderData->billing_address->phone}]]></telefon> {if $billingAddressName != $shippingAddressName || $billingAddress != $shippingAddress} <abweichendelieferadresse>1</abweichendelieferadresse> {if $orderData->shipping_address->company != ""} <lieferadresse_name><![CDATA[{$orderData->shipping_address->company}]]></lieferadresse_name> <lieferadresse_ansprechpartner><![CDATA[{$shippingAddressName}]]></lieferadresse_ansprechpartner> {else} <lieferadresse_name><![CDATA[{$shippingAddressName}]]></lieferadresse_name> {/if} <lieferadresse_strasse><![CDATA[{$shippingAddress}]]></lieferadresse_strasse> <lieferadresse_plz><![CDATA[{$orderData->shipping_address->zip}]]></lieferadresse_plz> <lieferadresse_ort><![CDATA[{$orderData->shipping_address->city}]]></lieferadresse_ort> <lieferadresse_land><![CDATA[{$orderData->shipping_address->country_code}]]></lieferadresse_land> <telefon><![CDATA[{$orderData->shipping_address->phone}]]></telefon> {/if} {*ITEM LOGIC*} <articlelist> {foreach key=lineItemKey item=lineItem from=$orderData->line_items} <{$lineItemKey}> <articleid><![CDATA[{$lineItem->sku}]]></articleid> <fremdnummer><![CDATA[{$lineItem->variant_id}]]></fremdnummer> <name><![CDATA[{$lineItem->name}]]></name> <quantity><![CDATA[{$lineItem->quantity}]]></quantity> <price><![CDATA[{$lineItem->price}]]></price> {foreach key=taxKey item=taxItem from=$lineItem->tax_lines} <steuersatz><![CDATA[{$taxItem->rate * 100}]]></steuersatz> {/foreach} </{$lineItemKey}> {/foreach} </articlelist> </xml>
In the following code snippet you can find the default template for Shopware 5.
<?xml version="1.0" encoding="UTF-8"?><xml> {*START PREPARING*} {assign var=orderData value=$cart->order} {*END PREPARING*} {*START FILLING THE CART*} <auftrag><![CDATA[{$orderData->id}]]></auftrag> <subshop><![CDATA[{$orderData->shopId}]]></subshop> <onlinebestellnummer><![CDATA[{$orderData->number}]]></onlinebestellnummer> <gesamtsumme><![CDATA[{$orderData->invoiceAmount}]]></gesamtsumme> <zahlungsweise><![CDATA[{$orderData->payment->name}]]></zahlungsweise> <bestelldatum><![CDATA[{$orderData->orderTime|truncate:10:""}]]></bestelldatum> <versandkostenbrutto><![CDATA[{$orderData->invoiceShipping}]]></versandkostenbrutto> <email><![CDATA[{$orderData->customer->email}]]></email> <lieferung><![CDATA[{$orderData->dispatch->name}]]></lieferung> <transaktionsnummer><![CDATA[{$orderData->transactionId}]]></transaktionsnummer> <waehrung><![CDATA[{$orderData->currency}]]></waehrung> {*ADDRESS LOGIC*} <anrede>herr</anrede> {if $orderData->billing->salutation == 'mrs'} <anrede>frau</anrede> {/if} {if $orderData->billing->company != ""} <anrede>firma</anrede> <name><![CDATA[{$orderData->billing->company}]]></name> <ansprechpartner><![CDATA[{$orderData->billing->firstName} {$orderData->billing->lastName}]]></ansprechpartner> {else} <name><![CDATA[{$orderData->billing->firstName} {$orderData->billing->lastName}]]></name> {/if} <strasse><![CDATA[{$orderData->billing->street}]]></strasse> <plz><![CDATA[{$orderData->billing->zipCode}]]></plz> <ort><![CDATA[{$orderData->billing->city}]]></ort> <ustid><![CDATA[{$orderData->billing->vatId}]]></ustid> <land><![CDATA[{$orderData->billing->country->iso}]]></land> {if $orderData->shipping->firstName != $orderData->billing->firstName || $orderData->shipping->street != $orderData->billing->street || $orderData->shipping->country->iso != $orderData->billing->country->iso} {if $address->attributes->company != ""} <lieferadresse_name><![CDATA[{$orderData->shipping->company}]]></lieferadresse_name> <lieferadresse_ansprechpartner><![CDATA[{$orderData->shipping->firstName} {$orderData->shipping->lastName}]]></lieferadresse_ansprechpartner> {else} <lieferadresse_name><![CDATA[{$orderData->shipping->firstName} {$orderData->shipping->lastName}]]></lieferadresse_name> {/if} <lieferadresse_strasse><![CDATA[{$orderData->shipping->street}]]></lieferadresse_strasse> <lieferadresse_plz><![CDATA[{$orderData->shipping->zipCode}]]></lieferadresse_plz> <lieferadresse_ort><![CDATA[{$orderData->shipping->city}]]></lieferadresse_ort> <lieferadresse_ustid><![CDATA[{$orderData->shipping->vatId}]]></lieferadresse_ustid> <lieferadresse_land><![CDATA[{$orderData->shipping->country->iso}]]></lieferadresse_land> {/if} {*ITEM LOGIC*} <articlelist> {foreach key=lineItemKey item=detail from=$orderData->details} <{$lineItemKey}> <articleid><![CDATA[{$detail->articleNumber}]]></articleid> <name><![CDATA[{$detail->articleName}]]></name> <quantity><![CDATA[{$detail->quantity}]]></quantity> <price><![CDATA[{$detail->price}]]></price> <steuersatz><![CDATA[{$detail->taxRate}]]></steuersatz> </{$lineItemKey}> {/foreach} </articlelist> </xml>
In the following code snippet you can find the default template for Shopware 6.
<?xml version="1.0" encoding="UTF-8"?><xml> {*START PREPARING*} {assign var=orderData value=$cart->order} {*PREPARE ADDRESS*} {assign var=billingAddressId value=$orderData->attributes->billingAddressId} {*END PREPARING*} {*START FILLING THE CART*} <auftrag><![CDATA[{$orderData->id}]]></auftrag> <onlinebestellnummer><![CDATA[{$orderData->attributes->orderNumber}]]></onlinebestellnummer> <gesamtsumme><![CDATA[{$orderData->attributes->amountTotal}]]></gesamtsumme> <zahlungsweise><![CDATA[{$orderData->paymentMethod->data->attributes->name}]]></zahlungsweise> <bestelldatum><![CDATA[{$orderData->attributes->orderDate|truncate:10:""}]]></bestelldatum> <versandkostenbrutto><![CDATA[{$orderData->attributes->shippingTotal}]]></versandkostenbrutto> {foreach key=customerKey item=customer from=$orderData->customer->data} <email><![CDATA[{$customer->attributes->email}]]></email> {/foreach} <lieferung></lieferung> {foreach key=shippingKey item=shipping from=$orderData->shippingMethod->data} <lieferung><![CDATA[{$shipping->attributes->name}]]></lieferung> {/foreach} <transaktionsnummer></transaktionsnummer> {foreach key=addressKey item=address from=$orderData->transactions->data} <transaktionsnummer><![CDATA[{$orderData->transactionId}]]></transaktionsnummer> {/foreach} {*ADDRESS LOGIC*} <anrede>herr</anrede> {foreach key=salutationKey item=salutation from=$orderData->addresses->included} {if $salutation->type == "salutation"} {if $salutation->attributes->salutationKey != 'mr'} <anrede>frau</anrede> {/if} {/if} {/foreach} {foreach key=addressKey item=address from=$orderData->addresses->data} {if $address->id == $billingAddressId} {if $address->attributes->company != ""} <anrede>firma</anrede> <name><![CDATA[{$address->attributes->company}]]></name> <ansprechpartner><![CDATA[{$address->attributes->firstName} {$address->attributes->lastName}]]></ansprechpartner> {else} <name><![CDATA[{$address->attributes->firstName} {$address->attributes->lastName}]]></name> {/if} <strasse><![CDATA[{$address->attributes->street}]]></strasse> <plz><![CDATA[{$address->attributes->zipcode}]]></plz> <ort><![CDATA[{$address->attributes->city}]]></ort> <ustid><![CDATA[{$address->attributes->vatId}]]></ustid> {foreach key=countryKey item=country from=$orderData->addresses->included} {if $country->id == $address->attributes->countryId} <land><![CDATA[{$country->attributes->iso}]]></land> {/if} {/foreach} {else} {if $address->attributes->company != ""} <lieferadresse_name><![CDATA[{$address->attributes->company}]]></lieferadresse_name> <lieferadresse_ansprechpartner><![CDATA[{$address->attributes->firstName} {$address->attributes->lastName}]]></lieferadresse_ansprechpartner> {else} <lieferadresse_name><![CDATA[{$address->attributes->firstName} {$address->attributes->lastName}]]></lieferadresse_name> {/if} <lieferadresse_strasse><![CDATA[{$address->attributes->street}]]></lieferadresse_strasse> <lieferadresse_plz><![CDATA[{$address->attributes->zipcode}]]></lieferadresse_plz> <lieferadresse_ort><![CDATA[{$address->attributes->city}]]></lieferadresse_ort> <lieferadresse_ustid><![CDATA[{$address->attributes->vatId}]]></lieferadresse_ustid> {foreach key=countryKey item=country from=$orderData->addresses->included} {if $country->id == $address->attributes->countryId} <lieferadresse_land><![CDATA[{$country->attributes->iso}]]></lieferadresse_land> {/if} {/foreach} {/if} {/foreach} {*ITEM LOGIC*} <articlelist> {foreach key=lineItemKey item=lineItem from=$orderData->lineItems->data} <{$lineItemKey}> <articleid><![CDATA[{$lineItem->attributes->payload->productNumber}]]></articleid> <name><![CDATA[{$lineItem->attributes->label}]]></name> <quantity><![CDATA[{$lineItem->attributes->quantity}]]></quantity> <price><![CDATA[{$lineItem->attributes->price->unitPrice}]]></price> {foreach key=taxKey item=tax from=$lineItem->attributes->price->calculatedTaxes} <steuersatz><![CDATA[{$tax->taxRate}]]></steuersatz> {/foreach} </{$lineItemKey}> {/foreach} </articlelist> </xml>
In the following code snippet you can find the default template for Gambio.
<?xml version="1.0" encoding="UTF-8"?><xml> {*START PREPARING*} {assign var=orderData value=$cart->order} {*END PREPARING*} {*START FILLING THE CART*} <auftrag><![CDATA[{$orderData->id}]]></auftrag> <onlinebestellnummer><![CDATA[{$orderData->id}]]></onlinebestellnummer> <zahlungsweise><![CDATA[{$orderData->paymentType->module}]]></zahlungsweise> <bestelldatum><![CDATA[{$orderData->purchaseDate|truncate:10:""}]]></bestelldatum> <email><![CDATA[{$orderData->customer->email}]]></email> <lieferung><![CDATA[{$orderData->shippingType->module}]]></lieferung> <waehrung><![CDATA[{$orderData->currencyCode}]]></waehrung> {foreach key=detailKey item=detail from=$orderData->totals} {if $detail->class == "ot_total"} <gesamtsumme><![CDATA[{$detail->value}]]></gesamtsumme> {/if} {if $detail->class == "ot_shipping"} <versandkostenbrutto><![CDATA[{$detail->value}]]></versandkostenbrutto> {/if} {if $detail->class == "ot_discount"} <rabattbrutto><![CDATA[{$detail->value}]]></rabattbrutto> {/if} {/foreach} <transaktionsnummer><![CDATA[{$orderData->transactionId}]]></transaktionsnummer> {*ADDRESS LOGIC*} <anrede>herr</anrede> {if $orderData->addresses->billing->gender == 'f'} <anrede>frau</anrede> {/if} <name><![CDATA[{$orderData->addresses->billing->firstname} {$orderData->addresses->billing->lastname}]]></name> {if $orderData->addresses->billing->company != ""} <anrede>firma</anrede> <name><![CDATA[{$orderData->addresses->billing->company}]]></name> <ansprechpartner><![CDATA[{$orderData->addresses->billing->firstname} {$orderData->addresses->billing->lastname}]]></ansprechpartner> {/if} <strasse><![CDATA[{$orderData->addresses->billing->street}]]></strasse> <plz><![CDATA[{$orderData->addresses->billing->postcode}]]></plz> <ort><![CDATA[{$orderData->addresses->billing->city}]]></ort> <ustid><![CDATA[{$orderData->customer->vatId}]]></ustid> <land><![CDATA[{$orderData->country->iso2}]]></land> {if $orderData->addresses->billing->firstname != $orderData->addresses->delivery->firstname || $orderData->addresses->billing->street != $orderData->addresses->delivery->street || $orderData->addresses->billing->city !=$orderData->addresses->delivery->city} <lieferadresse_name><![CDATA[{$orderData->addresses->delivery->firstname} {$orderData->addresses->delivery->lastname}]]></lieferadresse_name> {if $orderData->addresses->delivery->company != ""} <lieferadresse_name><![CDATA[{$orderData->addresses->delivery->company}]]></lieferadresse_name> <lieferadresse_ansprechpartner><![CDATA[{$orderData->addresses->delivery->firstname} {$orderData->addresses->delivery->lastname}]]></lieferadresse_ansprechpartner> {/if} <lieferadresse_strasse><![CDATA[{$orderData->addresses->delivery->street}]]></lieferadresse_strasse> <lieferadresse_plz><![CDATA[{$orderData->addresses->delivery->postcode}]]></lieferadresse_plz> <lieferadresse_ort><![CDATA[{$orderData->addresses->delivery->city}]]></lieferadresse_ort> <lieferadresse_ustid><![CDATA[{$orderData->addresses->delivery->vatId}]]></lieferadresse_ustid> <lieferadresse_land><![CDATA[{$orderData->deliveryCountry->iso2}]]></lieferadresse_land> {/if} {*ITEM LOGIC*} <articlelist> {foreach key=lineItemKey item=detail from=$orderData->items} <{$lineItemKey}> <articleid><![CDATA[{$detail->model}]]></articleid> <name><![CDATA[{$detail->name}]]></name> <quantity><![CDATA[{$detail->quantity}]]></quantity> <price><![CDATA[{$detail->price}]]></price> <steuersatz><![CDATA[{$detail->tax}]]></steuersatz> </{$lineItemKey}> {/foreach} </articlelist> </xml>
Finally, we'll show you a few useful examples around Smarty in Shopimporter.
Search for a syntactically correct Amazon order number in a string. A Regular Expression is used to search for the pattern of an Amazon order number in a string. If it occurs, it is compared to an arbitrary test constant (in this case "AMZ-FOUND") for comparison. The output of the number then appears with any prepended or trailing text, or just as a number.
<?xml version="1.0" encoding="UTF-8"?> <xml> {assign var=amznr value="Hello world this number is found: 302-9327276-6331545 - here could be more text"} {assign var=amznr1 value="Hello world this number is NOT found: 32-9327276-6331545 - no matter what text follows"} {if $amznr|regex_replace:"/^(.*)(\d{ldelim}3{rdelim}-\d{ldelim}7{rdelim}-\d{ldelim}7{rdelim})(.*)$/":"AMZ-FOUND" === "AMZ-FOUND"} <test>{$amznr|regex_replace:"/^(.*)(\d{ldelim}3{rdelim}-\d{ldelim}7{rdelim}-\d{ldelim}7{rdelim})(.*)$/":"Amazon number found: \\2"}</test> {else} <test>No Amazon number found</test> {/if} </xml>
Street and house number are separated in two fields after an update of the store importer in version 20.2. If needed, you can merge the data again with the following Smarty template:
<?xml version="1.0" encoding="UTF-8"?> <xml> <order> <billing> <address_1>{$cart->order->billing->address_1} {$cart->order->billing->address_2}</address_1> <address_2></address_2> </billing> <shipping> <address_1>{$cart->order->shipping->address_1} {$cart->order->shipping->address_2}</address_1> <address_2></address_2> </shipping> </order> </xml>
Other settings: Replace shopping cart must not be checked.
Phone information from billing_address and shipping_address may not be transferred yet, depending on the xentral Shopimporter version. In this case the following workaround will help you. The following Smarty template adds the phone number:
<?xml version="1.0" encoding="UTF-8"?> <xml> <auftragsdaten> <phone>{$cart->auftragsdaten->billing_address->phone}</phone> </auftragsdaten> </xml>
Other settings: Replace shopping cart must not be checked. For the sake of clarity, wrapping via CDATA has been omitted.
When using the plugin Bogx Product Configurator you can take over configuration data from the plugin as follows:
<?xml version="1.0"?> <xml> <articlelist> {if isset($object->articlelist)} {foreach key=key item=item from=$object->articlelist} {if isset($object->order->details) } {foreach key=keyorder item=orderitem from=$object->order->details } {if $key = $keyorder} {if $orderitem->attribute->bogxProductconfigurator} <{$keyorder}> <anabregs_text> {$orderitem->attribute->bogxProductconfigurator|jsondecode assign="json"}{$json->additionaltext|escapeXml} </anabregs_text> </{$keyorder}> {else} <{$keyorder}> <anabregs_text></anabregs_text> </{$keyorder}> {/if} {/if} {/foreach} {/if} {/foreach} {/if} </articlelist> </xml>
For the sake of clarity, wrapping via CDATA has been omitted.
When using dynamic sets (so-called custom bundles) in Shopify, the dynamic parts are replaced by real items in the shopping cart from the transmitted data in the shopping cart. This way you can handle the following processes in xentral by default.
<?xml version="1.0"?> <xml> {* DEFINITIONEN --- START *} {assign var="discountsku" value="<Artikelnummer für Discount-Artikel>"} {assign var="discountvariantid" value="<VariantID für Discount-Artikel>"} {* DEFINITIONEN --- ENDE *} <articlelist> {if isset($cart->auftragsdaten->line_items)} {assign var="row" value=0} {foreach key=key item=item from=$cart->auftragsdaten->line_items} {assign var="bundlename" value=$item->title} {assign var="bundlequantity" value=$item->quantity} {assign var="currentParentInCart" value=$row} <item{$row}> <articleid>{$item->sku}</articleid> <fremdnummer>{$item->variant_id}</fremdnummer> <name>{$item->title}</name> <options>{$item->variant_title}</options> <price>{$item->price}</price> {foreach key=taxKey item=taxItem from=$item->tax_lines} <steuersatz>{$taxItem->rate * 100}</steuersatz> {assign var="bundletax" value=$taxItem->rate * 100} {/foreach} <quantity>{$item->quantity}</quantity> <total_discount>{$item->total_discount}</total_discount> </item{$row}> {$row = $row +1} {if isset($item->properties)} {foreach key=pKey item=pItem from=$item->properties} {if $pItem->name == "_is_bundle"} {assign var="ready" value=false} {assign var="bundlepos" value=0} {assign var="bundleitemtitle" value=""} {assign var="bundleitemsku" value=""} {assign var="bundleitemprice" value=0} {assign var="bundleitemdesc" value=""} {assign var="bundleitemvariantid" value=""} {/if} {if $pItem->name|truncate:15:"" == "_product_title_"} {assign var="bundleitemtitle" value=$pItem->value|truncate:34:"...":true} {/if} {if $pItem->name|truncate:13:"" == "_product_sku_"} {assign var="bundleitemsku" value=$pItem->value} {/if} {if $pItem->name|truncate:15:"" == "_product_price_"} {assign var="bundleitemprice" value=$pItem->value} {/if} {if $pItem->name|truncate:14:"" == "_product_desc_"} {assign var="bundleitemdesc" value=$pItem->value|strip:" "} {if $bundleitemdesc == "Title: Default Title"} {assign var="bundleitemdesc" value="Einzelartikel"} {/if} {/if} {if $pItem->name|truncate:19:"" == "_product_variantid_"} {assign var="bundleitemvariantid" value=$pItem->value} {assign var="ready" value=true} {/if} {if $ready} {if $bundleitemsku == $discountsku} <item{$row}> <parentInCart>{$currentParentInCart}</parentInCart> <hidePrice>1</hidePrice> <articleid>{$bundleitemsku}</articleid> <fremdnummer>{$discountvariantid}</fremdnummer> <name>{$bundleitemtitle} {$bundlename}: {$bundleitemprice|string_format:"%.2f"|replace:".":","} EUR</name> <price>0.00</price> <price_netto /> <steuersatz>{$bundletax}</steuersatz> <quantity>{$bundlequantity}</quantity> </item{$row}> {else} <item{$row}> <parentInCart>{$currentParentInCart}</parentInCart> <hidePrice>1</hidePrice> <articleid>{$bundleitemsku}</articleid> <fremdnummer>{$bundleitemvariantid}</fremdnummer> <name>{$bundleitemtitle}</name> <options> <![CDATA[ {$bundleitemdesc|replace:" - ":"\n "}\n Einzelpreis: {$bundleitemprice|string_format:"%.2f"|replace:".":","} EUR]]> </options> <price>0.00</price> <price_netto /> {foreach key=taxKey item=taxItem from=$item->tax_lines} <steuersatz>{$taxItem->rate * 100}</steuersatz> {/foreach} <quantity>{$bundlequantity}</quantity> </item{$row}> {/if} {* Alle Elemente zuruecksetzen fuer neuen Artikel im Set *} {assign var="ready" value=false} {assign var="bundlepos" value=0} {assign var="bundleitemtitle" value=""} {assign var="bundleitemsku" value=""} {assign var="bundleitemprice" value=0} {assign var="bundleitemdesc" value=""} {assign var="bundleitemvariantid" value=""} {$row = $row +1} {/if} {/foreach} {* laufe durch die properties *} {/if} {* properties sind da *} {/foreach}{* auftragsdaten->line_items durchlaufen *} {/if} {* auftragsdaten->line_items existieren *} </articlelist> </xml>
For the sake of clarity, wrapping via CDATA has been omitted. However, this is highly recommended, especially for item descriptions and names.
Shopify Payments may not transfer detailed information about the selected payment method. However, since this is essential for further processing in xentral, you can use the following script to map the payment method into subtypes and then assign them correctly in xentral.
{assign var="is_klarna" value=0} {foreach from=$cart->tansactions->transactions key=keyrow item=el} {if $el->receipt->payment_method_details->type === "klarna"} {assign var="is_klarna" value=1} {/if} {/foreach} <zahlungsweise>{if $cart->auftragsdaten->gateway === "shopify_payments" && $is_klarna === 1}klarna{else}{$cart->zahlungsweise}{/if}</zahlungsweise>
Depending on which plugin is used in WooCommerce, it may be necessary to determine the salutation from different fields. In this case, you can use the following script as a starting point for your own customizations.
Please note that the adjustment of the salutation in the address master data is used in the imported order, but not in the created address master data.
<?xml version="1.0" encoding="UTF-8"?><xml> {assign var=orderData value=$cart->order} {if $orderData->billing->title == "1"} <anrede>mr.</anrede> {else} <anrede>mrs.</anrede> {/if} {if $orderData->billing->company != ""} <anrede>company</anrede> {/if} </xml>