mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-11-14 20:17:14 +01:00
Merge pull request #132 from exciler/bogx_configurator
Bogx configurator (Shopware6)
This commit is contained in:
commit
606cf543d1
@ -3374,6 +3374,7 @@ class Shopimporter_Shopware6 extends ShopimporterBase
|
||||
$productPriceType => $lineItem['attributes']['price']['unitPrice'],
|
||||
'steuersatz' => $lineItem['attributes']['price']['calculatedTaxes'][0]['taxRate'],
|
||||
];
|
||||
$this->parseBogxData($lineItem, $product);
|
||||
$cart['articlelist'][] = $product;
|
||||
}
|
||||
|
||||
@ -3845,4 +3846,48 @@ class Shopimporter_Shopware6 extends ShopimporterBase
|
||||
|
||||
$this->updateArticleCacheToSync($articleIds);
|
||||
}
|
||||
|
||||
protected function parseBogxData(array $lineItem, array &$product) : void
|
||||
{
|
||||
if (!isset($lineItem['attributes']['payload']['bogxProductConfigurator']))
|
||||
return;
|
||||
|
||||
$bogxdata = $lineItem['attributes']['payload']['bogxProductConfigurator'];
|
||||
$textlines = [];
|
||||
|
||||
if (isset($bogxdata['ordercode']))
|
||||
$textlines[] = "Order-Code: ${bogxdata['ordercode']}";
|
||||
|
||||
foreach ($bogxdata['optionsGroups'] as $bogxposition) {
|
||||
$dt = $bogxposition['datatype'];
|
||||
if ($dt == 'quantity_total')
|
||||
continue;
|
||||
if (is_array($bogxposition['valueID']) && is_array($bogxposition['title']))
|
||||
{
|
||||
foreach ($bogxposition['valueID'] as $valueID) {
|
||||
$bogxTitle = $bogxposition['title'][$valueID];
|
||||
if ($dt == 'checkbox_quantity')
|
||||
$bogxTitle = $bogxposition['label'][$valueID]." ".$bogxTitle;
|
||||
$textlines[] = sprintf("%s: %s", $bogxposition['groupname'], $bogxTitle);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (is_array($bogxposition['title']))
|
||||
$bogxTitle = join(' ', $bogxposition['title']);
|
||||
else
|
||||
$bogxTitle = $bogxposition['title'];
|
||||
$textlines[] = sprintf("%s: %s", $bogxposition['groupname'], $bogxTitle);
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($bogxdata['shippingtime'])) {
|
||||
$textlines[] = $bogxdata['shippingtime'];
|
||||
}
|
||||
|
||||
$product['options'] .= join("\n", $textlines);
|
||||
$product['price'] = $bogxdata['unitySurcharge'];
|
||||
$product['price_netto'] = $bogxdata['unitySurchargeNetto'];
|
||||
$product['quantity'] = $bogxdata['totalQuantity'];
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user