From a44accbac054db8cd9cceeffc3f5086ab1190c47 Mon Sep 17 00:00:00 2001 From: Daniel Schmitzer Date: Tue, 17 Sep 2024 13:26:02 +0000 Subject: - Optionale Produktbestandsanzeige git-svn-id: https://[internal]/wordpress/plugins/wpsg4@8430 0d5edaf7-2b12-4e95-93f4-047927463d4b --- views/mods/mod_productvariants/settings_edit.phtml | 4 ++++ views/mods/mod_stock/product_addedit_content.phtml | 11 +++++++++ views/produkttemplates/standard.phtml | 27 +++++++++++++++++++--- 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/views/mods/mod_productvariants/settings_edit.phtml b/views/mods/mod_productvariants/settings_edit.phtml index 6f9aa6f..ebbd8c1 100644 --- a/views/mods/mod_productvariants/settings_edit.phtml +++ b/views/mods/mod_productvariants/settings_edit.phtml @@ -30,6 +30,10 @@ 'hint' => __('Ist diese Option aktiv, so wird bei Kauf der Bestand in den Varianten nicht verringert.', 'wpsg'), 'help' => 'wpsg_vp_product_stock_varinotchange' ]); ?> + get_option('wpsg_vp_product_stock_display'), [ + 'hint' => __('Ist diese Option aktiv, so wird im nur der Produktbestand im PRodukttemplate (Frontend) angezeigt..', 'wpsg'), 'help' => 'wpsg_vp_product_stock_display' + ]); ?> + diff --git a/views/mods/mod_stock/product_addedit_content.phtml b/views/mods/mod_stock/product_addedit_content.phtml index ede1099..d7b3f63 100644 --- a/views/mods/mod_stock/product_addedit_content.phtml +++ b/views/mods/mod_stock/product_addedit_content.phtml @@ -52,6 +52,17 @@ 'hint' => __('Ist hier "nicht verringern" aktiviert, so wird der Bestand in der Variante beim Kauf nicht reduziert.', 'wpsg') ]); ?> + wpsg_translate( + __('Voreinstellung (#1#)', 'wpsg'), + (($this->get_option('wpsg_vp_product_stock_display') === '1')?'Produktbestand':'Variantenbestand') + ), + '2' => __('Variantenbestand'), + '1' => __('Produktbestand') + ], $oProduct->getMeta('wpsg_vp_product_stock_display'), [ + 'hint' => __('Bestimmt ob der Variantenbestand (Produktbestand + Variantenbestand) oder nur der Produktbestand im Frontend angezeigt werden soll.', 'wpsg') + ]); ?> + diff --git a/views/produkttemplates/standard.phtml b/views/produkttemplates/standard.phtml index 13e8357..c517bd8 100644 --- a/views/produkttemplates/standard.phtml +++ b/views/produkttemplates/standard.phtml @@ -189,14 +189,35 @@
- hasMod('wpsg_mod_stock') && $this->get_option('wpsg_mod_stock_showProduct') == '1') { ?> + hasMod('wpsg_mod_stock') && $this->get_option('wpsg_mod_stock_showProduct') == '1') { + + $stock_source_display = '0'; // Variantenbestand + + if ($oProduct->getMeta('wpsg_vp_product_stock_display', false, '0') === '0') { + + // Einstellung + if ($this->get_option('wpsg_vp_product_stock_display') === '1') $stock_source_display = '1'; + + } else if ($oProduct->getMeta('wpsg_vp_product_stock_display') === '1') { + + $stock_source_display = '1'; // Produktbestand + + } + + $stock_display = $this->view['data']['stock']; + + if ($stock_source_display === '1') $stock_display = $oProduct->__get('stock'); + + ?>
- view['data']['stock']) > 0) {?> + 0) {?> - view['data']['stock']); ?> + -- cgit v1.2.3