From d284b8e2542796510cb01b54868ed8fe1faa78c0 Mon Sep 17 00:00:00 2001 From: OpenXE <> Date: Tue, 26 Mar 2024 14:04:31 +0000 Subject: [PATCH] shopexport shopware6 texteuebertragen option --- upgrade/data/db_schema.json | 2 +- www/lib/class.remote.php | 5 +++++ www/pages/shopimporter_shopware6.php | 6 +++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/upgrade/data/db_schema.json b/upgrade/data/db_schema.json index 38b99656..622f4921 100644 --- a/upgrade/data/db_schema.json +++ b/upgrade/data/db_schema.json @@ -92703,7 +92703,7 @@ "Collation": null, "Null": "NO", "Key": "", - "Default": "0", + "Default": "1", "Extra": "", "Privileges": "select,insert,update,references", "Comment": "" diff --git a/www/lib/class.remote.php b/www/lib/class.remote.php index b542d48b..0eb67ede 100644 --- a/www/lib/class.remote.php +++ b/www/lib/class.remote.php @@ -1214,8 +1214,10 @@ class Remote $projektlager = $this->app->DB->Select("SELECT id FROM projekt WHERE id = $projekt AND projektlager = 1 LIMIT 1"); $tmp = new ObjGenArtikel($this->app); $cartikel_arr = !empty($artikel_arr)?count($artikel_arr):0; + for($i=0;$i<$cartikel_arr;$i++) { + $artikel = $artikel_arr[$i]; $lagerexport = $this->app->erp->GetArtikelShopEinstellung('autolagerlampe', $artikel, $shopexportarr); $tmp->Select($artikel); @@ -1260,6 +1262,9 @@ class Remote $data[$i]['uebersicht_de'] = htmlspecialchars($tmp->GetUebersicht_De(),ENT_QUOTES); $data[$i]['uebersicht_en'] = htmlspecialchars($tmp->GetUebersicht_En(),ENT_QUOTES); $data[$i]['herkunftsland'] = $tmp->GetHerkunftsland(); + + $data[$i]['texteuebertragen'] = $shopexportarr['texteuebertragen']; + if(method_exists($tmp,'GetMetadescription_De')) { $data[$i]['metadescription_de'] = $tmp->GetMetadescription_De(); diff --git a/www/pages/shopimporter_shopware6.php b/www/pages/shopimporter_shopware6.php index 61872a2e..21b1216e 100644 --- a/www/pages/shopimporter_shopware6.php +++ b/www/pages/shopimporter_shopware6.php @@ -1054,6 +1054,10 @@ class Shopimporter_Shopware6 extends ShopimporterBase 'deliveryTimeId' => $deliveryTimeId ]; + if (!$article['texteuebertragen']) { + unset($data['description']); + } + $data = array_merge($data, $systemFieldsToAdd); if(empty($data['customFields']) || empty($data['customFields']['wawision_shopimporter_syncstate'])){ @@ -1077,7 +1081,7 @@ class Shopimporter_Shopware6 extends ShopimporterBase sprintf('product/%s?_response=true', $articleIdShopware), $data, $headerInformation); } - if(!empty($articleIdShopware)){ + if(!empty($articleIdShopware) && $article['texteuebertragen']) { $this->exportTranslationsForArticle($article, $articleIdShopware); }