ich habe eine Frage zum Bestellimport (XML) in CAO Faktura in Verbindung mit dem Variantenmodul.
Ausgangslage:
- Im Shop werden Produkte als Varianten verkauft (z. B. 100 g / 500 g / 1 kg).
In CAO existiert jede Variante als eigener Artikel und ist zusätzlich über das Variantenmodul mit einem Hauptartikel verknüpft.
Artikelstamm (EAN, ME, Preis) ist korrekt.
Manuell in CAO ausgewählte Varianten kommen korrekt an.
Per Bestellimport:
Wird der Artikel dem Vaterartikel zugeodnet.
Code: Alles auswählen
$schema .= '<ORDER_PRODUCTS>' . "\n";
$sql = "select
orders_products_id,
allow_tax,
products_id,
products_model,
products_name,
final_price,
products_tax,
products_quantity
from " .
TABLE_ORDERS_PRODUCTS . "
where
orders_id = '" . $orders['orders_id'] . "'";
$products_query = xtc_db_query($sql);
while ($products = xtc_db_fetch_array($products_query))
{
$products = encode_request($products);
if ($products['allow_tax']==1)
$products['final_price'] = $products['final_price'] / (1 + $products['products_tax'] * 0.01);
$schema .= '<PRODUCT>' . "\n" .
'<PRODUCTS_ID>' . $products['products_id'] . '</PRODUCTS_ID>' . "\n" .
'<PRODUCTS_QUANTITY>' . $products['products_quantity'] . '</PRODUCTS_QUANTITY>' . "\n" .
'<PRODUCTS_MODEL>' . encode_htmlspecialchars($products['products_model']) . '</PRODUCTS_MODEL>' . "\n" .
'<PRODUCTS_NAME>' . encode_htmlspecialchars($products['products_name']) . '</PRODUCTS_NAME>' . "\n" .
'<PRODUCTS_PRICE>' . $products['final_price'] / $products['products_quantity'] . '</PRODUCTS_PRICE>' . "\n" .
'<PRODUCTS_TAX>' . $products['products_tax'] . '</PRODUCTS_TAX>' . "\n".
'<PRODUCTS_TAX_FLAG>' . $products['allow_tax'] . '</PRODUCTS_TAX_FLAG>' . "\n";
$attributes_query = xtc_db_query(
"select
products_options,
products_options_values,
options_values_price,
attributes_model,
price_prefix
from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . "
where orders_id = '" .$orders['orders_id'] . "'
and orders_products_id = '" . $products['orders_products_id'] . "'"
);
if (xtc_db_num_rows($attributes_query))
{
while ($attributes = xtc_db_fetch_array($attributes_query))
{
$schema .= '<OPTION>' . "\n" .
'<PRODUCTS_OPTIONS>' . encode_htmlspecialchars($attributes['products_options']) . '</PRODUCTS_OPTIONS>' . "\n" .
'<PRODUCTS_OPTIONS_VALUES>' . encode_htmlspecialchars($attributes['products_options_values']) . '</PRODUCTS_OPTIONS_VALUES>' . "\n" .
'<PRODUCTS_OPTIONS_MODEL>' . encode_htmlspecialchars($attributes['attributes_model']) . '</PRODUCTS_OPTIONS_MODEL>' . "\n".
'<PRODUCTS_OPTIONS_PRICE>' . $attributes['price_prefix'] . ' ' . $attributes['options_values_price'] . '</PRODUCTS_OPTIONS_PRICE>' . "\n" .
'</OPTION>' . "\n";
}
}
$schema .= '</PRODUCT>' . "\n";
}
$schema .= '</ORDER_PRODUCTS>' . "\n";Ist es korrekt, dass der Bestellimport keine CAO-Varianten „aktivieren“ kann und Variantenartikel beim Import immer wie Hauptartikel behandelt werden (bezogen auf EAN/Mengeneinheit)?
Gibt es eine empfohlene Vorgehensweise, um Shop-Varianten als normale Artikel mit korrekter ME/EAN zu importieren, ohne die Variantenbeziehung im CAO-Artikelstamm aufzulösen?
Vielen Dank für eine kurze Einschätzung.
SG Armin
Ich habe die Version 1.5.1.33 und das Variantenmodul in Verwendung