From 8352f0594f5c6da5a1a7ca58b2ea490807768336 Mon Sep 17 00:00:00 2001 From: Daniel Schmitzer Date: Fri, 5 May 2023 11:06:39 +0000 Subject: - Feature: Produktkombinationen für Varianten - Feature: Productcodemanagement - Feature: Positionsnummer für Produktgruppen - Feature: Markierung wenn Produktgruppe aktiven Rabatt hat in Produktgruppenübersicht MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://[internal]/wordpress/plugins/wpsg4@8280 0d5edaf7-2b12-4e95-93f4-047927463d4b --- views/mods/mod_productgroups/add.phtml | 1 + views/mods/mod_productgroups/index.phtml | 4 + views/mods/mod_productgroups/list.phtml | 36 +- views/mods/mod_productgroups/show_2.phtml | 6 +- views/mods/mod_productvariants/admin_edit.phtml | 8 +- .../produkt_addedit_content.phtml | 582 +++++++++++---------- views/mods/mod_rechnungen/invoice_pdf.phtml | 6 +- views/order/product_table.phtml | 9 +- views/produkt/addedit_productcodes.phtml | 145 ++++- views/produkttemplates/standard.phtml | 9 +- 10 files changed, 472 insertions(+), 334 deletions(-) diff --git a/views/mods/mod_productgroups/add.phtml b/views/mods/mod_productgroups/add.phtml index 22983b0..2d304f6 100644 --- a/views/mods/mod_productgroups/add.phtml +++ b/views/mods/mod_productgroups/add.phtml @@ -69,6 +69,7 @@ view['templates'], $this->view['data']['template_file']); ?> view['pages'], $this->view['data']['infopage']); ?> + view['data']['pos']); ?>
diff --git a/views/mods/mod_productgroups/index.phtml b/views/mods/mod_productgroups/index.phtml index 18b19d1..b5cdc02 100644 --- a/views/mods/mod_productgroups/index.phtml +++ b/views/mods/mod_productgroups/index.phtml @@ -83,6 +83,7 @@ + @@ -122,6 +123,9 @@ template_file == "0")?'Individuelle Produkttemplates':$pg->template_file); ?> + + + pos; ?> countProducts(); ?> diff --git a/views/mods/mod_productgroups/list.phtml b/views/mods/mod_productgroups/list.phtml index 440af68..fbdaeff 100644 --- a/views/mods/mod_productgroups/list.phtml +++ b/views/mods/mod_productgroups/list.phtml @@ -11,9 +11,17 @@ ?> -view['data'] as $k => $g) { ?> +view['data'] as $k => $g) { + + $oProductgroup = wpsg_productgroup::getInstance(intval($k)); + + ?> -
+

@@ -35,17 +43,19 @@ - - = 0 && is_int($image)) { ?> -
- - + 0) { ?> + + = 0 && is_int($image)) { ?> +
+ + + + + +
+ + + diff --git a/views/mods/mod_productgroups/show_2.phtml b/views/mods/mod_productgroups/show_2.phtml index 2f8eaef..5d5db54 100644 --- a/views/mods/mod_productgroups/show_2.phtml +++ b/views/mods/mod_productgroups/show_2.phtml @@ -50,7 +50,11 @@ if (intval($oProductgroup->__get('infopage')) > 0) echo \get_permalink(intval($oProductgroup->__get('infopage'))); else echo $page_url.'show='.$oProductgroup->getId(); - ?>" class="productgroup"> + ?>" class="productgroup hasActiveDiscount())?'active_discount':''); + + ?>">
getLabel(); ?>
diff --git a/views/mods/mod_productvariants/admin_edit.phtml b/views/mods/mod_productvariants/admin_edit.phtml index ebfc9a6..57f7ddb 100644 --- a/views/mods/mod_productvariants/admin_edit.phtml +++ b/views/mods/mod_productvariants/admin_edit.phtml @@ -37,7 +37,7 @@ view['product_id'])) { $colspan += 2; ?> - + hasMod('wpsg_mod_stock')) { ?> @@ -170,7 +170,7 @@ view['product_id'])) { ?> - + get_option('wpsg_currency'))); ?> hasMod('wpsg_mod_stock')) { ?> @@ -316,7 +316,7 @@
- view['product_id'])) { ?> + view['product_id'])) { ?>
EAN: @@ -333,7 +333,7 @@
- + + + @@ -409,6 +428,7 @@ #wpsg_mod_productvars_combination .top_filter { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); row-gap:1rem; column-gap:1rem; margin-bottom:2rem; } #wpsg_mod_productvars_combination .top_filter select { width:100%; } #wpsg_mod_productvars_combination .panel-title { display:flex; justify-content:space-between; align-items:center; } + #wpsg_mod_productvars_combination .panel-title a.url { color:inherit; margin-right:1rem; display:inline-block; } #wpsg_mod_productvars_combination .panel-title .glyphicon { cursor:pointer; } #wpsg_mod_productvars_combination .panel { margin-bottom:10px; } #wpsg_mod_productvars_combination .loading_layer { z-index:10; position:absolute; left:0; top:0; width:100%; height:100%; background-color:rgba(255, 255, 255, 0.5); display:flex; justify-content:center; align-items:center; } diff --git a/views/mods/mod_rechnungen/invoice_pdf.phtml b/views/mods/mod_rechnungen/invoice_pdf.phtml index 6434ade..4f49dad 100644 --- a/views/mods/mod_rechnungen/invoice_pdf.phtml +++ b/views/mods/mod_rechnungen/invoice_pdf.phtml @@ -216,7 +216,9 @@ $bKopf = false; $pnr = 1; $offset = 0; $count = 0; foreach ($this->view['basket']['arCalculation']['product'] as $p) { + $product = wpsg_product::getInstance($p['product_id']); + if (($p['product_key']??'') !== '') $product->setProductKey($p['product_key']); if (!$bKopf) { @@ -256,8 +258,8 @@ if ($this->get_option('wpsg_mod_rechnungen_anr') == '1') $pdf->Cell(10, 8, $product->getNr(), 0, 0, 'C'); else $pdf->Cell(10, 8, $pnr.".", 0, 0, 'C'); - if ($this->get_option('wpsg_rechnungen_pdetailname') == '1') $produkt_text = $this->getProductName($this->getProduktID($p['product_id']), true); - else $produkt_text = $this->getProductName($this->getProduktID($p['product_id']), false); + if ($this->get_option('wpsg_rechnungen_pdetailname') == '1') $produkt_text = $product->getProductName(true); + else $produkt_text = $product->getProductName(false); $produktBeschreibung = trim(strip_tags($product->getShortDescription())); diff --git a/views/order/product_table.phtml b/views/order/product_table.phtml index 39ef05d..3fc4499 100644 --- a/views/order/product_table.phtml +++ b/views/order/product_table.phtml @@ -49,7 +49,12 @@ - + setProductKey($p['product_key']); + + ?> @@ -62,7 +67,7 @@ echo wp_nonce_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Produkt&action=edit&edit_id='.$p['product_id'], 'wpsg-product-edit-'.wpsg_getInt($p['product_id'])); ?>" title=""> - getProductName($p['product_id'])); ?> + getProductName(false)); ?> diff --git a/views/produkt/addedit_productcodes.phtml b/views/produkt/addedit_productcodes.phtml index 602a9b5..065eb86 100644 --- a/views/produkt/addedit_productcodes.phtml +++ b/views/produkt/addedit_productcodes.phtml @@ -10,7 +10,7 @@ */ namespace wpsg; - + ?>
@@ -22,37 +22,127 @@ /** @var \wpsg_product $oProduct */ $oProduct = \wpsg_product::getInstance(intval($this->view['data']['id'])); + $arData = []; + + foreach (\wpsg_product::getProductCodeConfig() as $code_key => $code_data) { + + $product_code = $oProduct->getMeta($code_key, false, ''); + + $arData[$code_key] = [ + 'label' => $code_data['label'], + 'code_key' => $code_key, + 'code' => trim($product_code), + 'set' => trim($product_code) !== '' + ]; + + } + ?> - - __('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.

+ +
+ +
+ +
+ + + + + + +
+ +

+ hasMod('wpsg_mod_productvariants')) { ?> + Ist das Produkt ein Variantenprodukt, können die Codes unter Produktvarianten für einzelne Variationen überschrieben werden.
+ + Änderungen müssen mit speichern bestätigt werden. +

@@ -60,6 +150,7 @@ +
diff --git a/views/produkttemplates/standard.phtml b/views/produkttemplates/standard.phtml index e64a94e..c09c9f9 100644 --- a/views/produkttemplates/standard.phtml +++ b/views/produkttemplates/standard.phtml @@ -12,7 +12,8 @@ /** @var wpsg_product $oProduct */ $oProduct = $this->view['oProduct']; - + if (($this->view['data']['product_key']??'') !== '') $oProduct->setProductKey($this->view['data']['product_key']); + ?>
@@ -23,7 +24,7 @@
titleDisplayed) { ?> -

getProductName($this->view['data']['id']); ?>

+

getProductName(); ?>

view['data']['detailname']; ?>

@@ -35,7 +36,7 @@