From 8ee6278ddee7a0bbc8f0652b0626d4f170d78a3e Mon Sep 17 00:00:00 2001 From: Daniel Schmitzer Date: Mon, 24 Apr 2023 12:56:25 +0000 Subject: - Anr aus Varianten / Nr. über Productcods MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://[internal]/wordpress/plugins/wpsg4@8279 0d5edaf7-2b12-4e95-93f4-047927463d4b --- views/mods/mod_printshop/producttemplate.phtml | 22 +- views/mods/mod_productvariants/admin_html.phtml | 20 +- .../produkt_addedit_content.phtml | 432 ++++++++++++++++++++- .../produkt_addedit_content_combination.phtml | 305 --------------- .../produkt_edit_allgemein.phtml | 7 - views/mods/mod_produktartikel/settings_edit.phtml | 5 - views/mods/mod_rechnungen/multi_invoice_pdf.phtml | 2 +- views/produkt/addedit_productcodes.phtml | 65 ++++ views/produkt/index.phtml | 14 - views/produkttemplates/standard.phtml | 40 +- views/produkttemplates/standard2.phtml | 23 +- views/produkttemplates/standard3.phtml | 27 +- 12 files changed, 567 insertions(+), 395 deletions(-) delete mode 100644 views/mods/mod_productvariants/produkt_addedit_content_combination.phtml create mode 100644 views/produkt/addedit_productcodes.phtml diff --git a/views/mods/mod_printshop/producttemplate.phtml b/views/mods/mod_printshop/producttemplate.phtml index 4092bb5..19e3cf0 100644 --- a/views/mods/mod_printshop/producttemplate.phtml +++ b/views/mods/mod_printshop/producttemplate.phtml @@ -83,14 +83,24 @@ get_option('wpsg_showArticelnumber') == '1') { ?>
: view['data']['anr']); ?>
- get_option('wpsg_mod_produktartikel_ean'))) {?> - :view['data']['ean']); ?>
+
+ + + getAllProductCodes(); ?> + 0) { ?> +
+ + + +
+ : +
+ + - get_option('wpsg_mod_produktartikel_gtin'))) {?> - :view['data']['gtin']); ?>
-
+ - + view['oProduct']->canDisplayPrice()) { ?> diff --git a/views/mods/mod_productvariants/admin_html.phtml b/views/mods/mod_productvariants/admin_html.phtml index dd225e0..6f49037 100644 --- a/views/mods/mod_productvariants/admin_html.phtml +++ b/views/mods/mod_productvariants/admin_html.phtml @@ -210,8 +210,7 @@ } - function wpsg_mod_productvariants_back() - { + function wpsg_mod_productvariants_back() { var product_id = jQuery('#wpsg_mod_productvariants_product_id').val(); @@ -234,16 +233,17 @@ jQuery('#wpsg_mod_productvariants_dialog .modal-body').html(data); + if (window.wpsg_mod_productvariants) window.wpsg_mod_productvariants.updateCombinationData(); + } - } ); + } ); return false; } // function wpsg_mod_productvariants_back() - function wpsg_mod_productvariants_show(product_id) - { - + function wpsg_mod_productvariants_show(product_id) { + jQuery('#wpsg_mod_productvariants_dialog button').prop('disabled', true); jQuery('#wpsg_mod_productvariants_dialog .modal-body').html('<?php echo __('Bitte warten ...', 'wpsg'); ?>'); @@ -261,11 +261,13 @@ jQuery('#wpsg_mod_productvariants_dialog .modal-body').html(data); jQuery('#wpsg_mod_productvariants_dialog button').prop('disabled', false); + if (window.wpsg_mod_productvariants) window.wpsg_mod_productvariants.updateCombinationData(); + } - } ); - + } ); + return false; - } // function wpsg_mod_productvariants_show() + } \ No newline at end of file diff --git a/views/mods/mod_productvariants/produkt_addedit_content.phtml b/views/mods/mod_productvariants/produkt_addedit_content.phtml index e38a1cf..50de7b4 100644 --- a/views/mods/mod_productvariants/produkt_addedit_content.phtml +++ b/views/mods/mod_productvariants/produkt_addedit_content.phtml @@ -1,33 +1,425 @@ - - - -view['data']['id'])) { ?> - view['wpsg_mod_productvariants']['html']; ?> +view['data']['id'])) { ?> + +

+ +view['data']['id'])); + + ?> + + + + view['wpsg_mod_productvariants']['html']; ?> + + + - + + + - /* ]]> */ - - - -

- - - - - - \ No newline at end of file +view['data']['id'])); - - $arVariantInfo = $this->callMod('wpsg_mod_productvariants', 'getVariants', [$oProduct->getId(), true, true, true]); - - $arVariant = []; $arVariantLabel = []; $arFilter = []; - $arVariationen = []; $arVariationLabel = []; - - foreach ($arVariantInfo as $var) { - - $arVariant[] = intval($var['id']); - $arVariationen[$var['id']] = []; - - foreach ($var['arVariation'] as $vari) { - - $arVariationen[intval($var['id'])][] = intval($vari['variation_id']); - - if (!in_array($var['id'], $arVariationLabel)) try { $arVariationLabel[$vari['variation_id']] = wpsg_variation::getInstance($vari['variation_id'])->getLabel(); } catch (\Exception $e) { $arVariationLabel[$vari['variation_id']] = $vari['variation_id']; } - - } - - if (!in_array($var['id'], $arVariantLabel)) try { $arVariantLabel[$var['id']] = wpsg_variant::getInstance($var['id'])->getLabel(); } catch (\Exception $e) { $arVariantLabel[$var['id']] = $var['id']; } - - $arFilter[$var['id']] = 0; - - } - - $arPossibleKeys = $oProduct->getPossibleProductVariantKeys(); - - foreach ($arPossibleKeys as $k => $v) { - - $arPossibleKeys[$k]['data'] = null; - - try { - - $arPossibleKeys[$k]['id'] = intval(wpsg_combination::findByProductAndKey($oProduct->getId(), $v['var_key'])->getId()); - - } catch (\Throwable $e) { $arPossibleKeys[$k]['id'] = 0; } - - } - -?> - -
-
-
- -
-
-
-
-
-

- {{combination.label}} - - -

-
-
- -
- <?php echo __('Bitte warten ...', 'wpsg'); ?> -
- -
- -
-
- -
-
-
-
- -
- -
- -
{{combination}}
- -
-
-
-
- - - - - \ No newline at end of file diff --git a/views/mods/mod_produktartikel/produkt_edit_allgemein.phtml b/views/mods/mod_produktartikel/produkt_edit_allgemein.phtml index 5b0359b..e4a96d6 100644 --- a/views/mods/mod_produktartikel/produkt_edit_allgemein.phtml +++ b/views/mods/mod_produktartikel/produkt_edit_allgemein.phtml @@ -8,10 +8,3 @@ ?> view['data']['post_name']), array('help' => 'wpsg_mod_produktartikel_url_path_seg')); ?> -get_option('wpsg_mod_produktartikel_ean'))) { ?> -view['data']['ean']), array('help' => 'wpsg_mod_produktartikel_ean')); ?> - - -get_option('wpsg_mod_produktartikel_gtin'))) { ?> -view['data']['gtin']), array('help' => 'wpsg_mod_produktartikel_gtin')); ?> - \ No newline at end of file diff --git a/views/mods/mod_produktartikel/settings_edit.phtml b/views/mods/mod_produktartikel/settings_edit.phtml index 604cd27..02b27dd 100644 --- a/views/mods/mod_produktartikel/settings_edit.phtml +++ b/views/mods/mod_produktartikel/settings_edit.phtml @@ -21,11 +21,6 @@
-get_option('wpsg_mod_produktartikel_ean'), array('help' => 'wpsg_mod_produktartikel_ean')); ?> -get_option('wpsg_mod_produktartikel_gtin'), array('help' => 'wpsg_mod_produktartikel_gtin')); ?> - -
- get_option('wpsg_mod_produktartikel_cat'), array('help' => 'wpsg_mod_produktartikel_cat')); ?>
get_option('wpsg_mod_produktartikel_cat_first_level'), array('help' => 'wpsg_mod_produktartikel_cat_first_level')); ?> diff --git a/views/mods/mod_rechnungen/multi_invoice_pdf.phtml b/views/mods/mod_rechnungen/multi_invoice_pdf.phtml index fcad732..f3d48e8 100644 --- a/views/mods/mod_rechnungen/multi_invoice_pdf.phtml +++ b/views/mods/mod_rechnungen/multi_invoice_pdf.phtml @@ -286,7 +286,7 @@ if ($this->get_option('wpsg_mod_rechnungen_anr') == '1') { - $pdf->Cell(10, 8, $oOrderProduct->getProduct()->getProductNr(), 0, 0, 'C'); + $pdf->Cell(10, 8, $oOrderProduct->getProduct()->getNr(), 0, 0, 'C'); } else { diff --git a/views/produkt/addedit_productcodes.phtml b/views/produkt/addedit_productcodes.phtml new file mode 100644 index 0000000..602a9b5 --- /dev/null +++ b/views/produkt/addedit_productcodes.phtml @@ -0,0 +1,65 @@ + + +
+
+ + + view['data']['id']) > 0) { + + /** @var \wpsg_product $oProduct */ + $oProduct = \wpsg_product::getInstance(intval($this->view['data']['id'])); + + ?> + + __('Erster definierter Code', 'wpsg'), + 'ean' => __('EAN als Standard', 'wpsg'), + 'gtin' => __('GTIN als Standard', 'wpsg'), + 'mpn' => __('MPN als Standard', 'wpsg'), + 'pzn' => __('PZN als Standard', 'wpsg'), + 'sku' => __('SKU als Standard', 'wpsg'), + 'upc' => __('UPC als Standard', 'wpsg'), + 'isbn' => __('ISBN als Standard', 'wpsg'), + 'issn' => __('ISSN als Standard', 'wpsg'), + 'isin' => __('ISIN als Standard', 'wpsg') + ], $oProduct->getMeta('code_mode', false, '0'), ['help' => 'code_mode']); ?> + getMeta('ean'), ['help' => 'ean']); ?> + getMeta('gtin'), ['help' => 'gtin']); ?> + getMeta('mpn'), ['help' => 'mpn']); ?> + getMeta('pzn'), ['help' => 'pzn']); ?> + getMeta('sku'), ['help' => 'sku']); ?> + getMeta('upc'), ['help' => 'upc']); ?> + getMeta('isbn'), ['help' => 'isbn']); ?> + getMeta('issn'), ['help' => 'issn']); ?> + getMeta('isin'), ['help' => 'isin']); ?> + + hasMod('wpsg_mod_productvariants')) { ?> + +
+ +

Ist das Produkt ein Variantenprodukt, können die Codes unter Produktvarianten für einzelne Variationen überschrieben werden.

+ + + + + +

+ + + + +
+
diff --git a/views/produkt/index.phtml b/views/produkt/index.phtml index 9a11630..825bfe4 100644 --- a/views/produkt/index.phtml +++ b/views/produkt/index.phtml @@ -201,14 +201,6 @@ - hasMod('wpsg_mod_produktartikel') && $this->get_option('wpsg_mod_produktartikel_gtin') == '1') { ?> - - - - hasMod('wpsg_mod_produktartikel') && $this->get_option('wpsg_mod_produktartikel_ean') == '1') { ?> - - - hasMod('wpsg_mod_deliverytime') && $this->get_option('wpsg_mod_deliverytime_productindex') == '1') { ?> @@ -336,12 +328,6 @@ ?> - hasMod('wpsg_mod_produktartikel') && $this->get_option('wpsg_mod_produktartikel_gtin') == '1') { ?> - - - hasMod('wpsg_mod_produktartikel') && $this->get_option('wpsg_mod_produktartikel_ean') == '1') { ?> - - hasMod('wpsg_mod_deliverytime') && $this->get_option('wpsg_mod_deliverytime_productindex') == '1') { ?> callMod('wpsg_mod_deliverytime', 'isStoreProduct', array($oProduct->getProductKey()))) { ?> diff --git a/views/produkttemplates/standard.phtml b/views/produkttemplates/standard.phtml index 4dc17a4..e64a94e 100644 --- a/views/produkttemplates/standard.phtml +++ b/views/produkttemplates/standard.phtml @@ -19,7 +19,7 @@ - +
titleDisplayed) { ?> @@ -35,11 +35,15 @@
- - - - - + + + + getAllProductCodes() as $product_code) { ?> + + + + + get_option('wpsg_showArticelnumber') == '1') { ?>
- : view['data']['anr']); ?>
- get_option('wpsg_mod_produktartikel_ean'))) {?> - :view['data']['ean']); ?>
+ : getNr()); ?>
+
+ + + getAllProductCodes(); ?> + 0) { ?> +
+ + + +
+ : +
+ + - get_option('wpsg_mod_produktartikel_gtin'))) {?> - :view['data']['gtin']); ?>
-
+
@@ -164,7 +178,7 @@ - +
view['data']['shortdesc']; ?> diff --git a/views/produkttemplates/standard2.phtml b/views/produkttemplates/standard2.phtml index 5658288..8db4bed 100644 --- a/views/produkttemplates/standard2.phtml +++ b/views/produkttemplates/standard2.phtml @@ -10,6 +10,7 @@ // Damit keine Zubehörprodukte ausgegeben werden //$this->noReleatedProducts = true; + /** @var wpsg_product $oProduct */ $oProduct = $this->view['oProduct']; $var_info = []; @@ -85,13 +86,23 @@ get_option('wpsg_showArticelnumber') == '1') { ?>
- : view['data']['anr']); ?>
- get_option('wpsg_mod_produktartikel_ean'))) {?> - :view['data']['ean']); ?>
+ : getNr()); ?>
+
+ + + getAllProductCodes(); ?> + 0) { ?> +
+ + + +
+ : +
+ + - get_option('wpsg_mod_produktartikel_gtin'))) {?> - :view['data']['gtin']); ?>
-
+
diff --git a/views/produkttemplates/standard3.phtml b/views/produkttemplates/standard3.phtml index 285d51e..a617630 100644 --- a/views/produkttemplates/standard3.phtml +++ b/views/produkttemplates/standard3.phtml @@ -69,15 +69,24 @@ get_option('wpsg_showArticelnumber') == '1') { ?>
- : view['data']['anr']); ?>
- get_option('wpsg_mod_produktartikel_ean'))) {?> - :view['data']['ean']); ?>
- - get_option('wpsg_mod_produktartikel_gtin'))) {?> - :view['data']['gtin']); ?>
- -
- + : getNr()); ?>
+
+ + + getAllProductCodes(); ?> + 0) { ?> +
+ + + +
+ : +
+ + + +
+ view['oProduct']->canDisplayPrice()) { ?> -- cgit v1.2.3