diff options
Diffstat (limited to 'views/mods')
7 files changed, 440 insertions, 353 deletions
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 @@ <?php if ($this->get_option('wpsg_showArticelnumber') == '1') { ?>
<div class="wpsg_artikelnummer">
<?php echo __('Artikelnummer', 'wpsg'); ?>: <span class="wpsg_anr"><?php echo wpsg_hspc($this->view['data']['anr']); ?></span><br />
- <?php if (wpsg_isSizedInt($this->get_option('wpsg_mod_produktartikel_ean'))) {?>
- <?php echo __('EAN','wpsg');?>:<span class="wpsg_ean"><?php echo wpsg_hspc($this->view['data']['ean']); ?></span><br />
+ </div>
+ <?php } ?>
+
+ <?php $arProductCodes = $oProduct->getAllProductCodes(); ?>
+ <?php if (sizeof($arProductCodes) > 0) { ?>
+ <div class="product_code_wrap">
+ <?php foreach ($arProductCodes as $product_code) { ?>
+ <?php if ($product_code !== null) { ?>
+
+ <div class="product_code <?php echo $product_code['code_key']; ?>">
+ <span class="label"><?php echo $product_code['label']; ?></span>: <span class="code"><?php echo $product_code['code']; ?></span>
+ </div>
+
+ <?php } ?>
<?php } ?>
- <?php if (wpsg_isSizedInt($this->get_option('wpsg_mod_produktartikel_gtin'))) {?>
- <?php echo __('GTIN','wpsg');?>:<span class="wpsg_gtin"><?php echo wpsg_hspc($this->view['data']['gtin']); ?></span><br />
- <?php }?></div>
+ </div>
<?php } ?>
-
+
<?php /* Abfrage Preisanzeige nur für eingeloggte User aktiv und User eingeloggt START*/ ?>
<?php if ($this->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('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?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()
+ }
</script>
\ 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 @@ <?php
-
+
+ declare(strict_types=1);
+
/**
* Template für die Verwaltung der Produktvarianten innerhalb des Produktes
+ * @author: Daniel Schmitzer (daschmi@daschmi.de)
+ * @date: 20.04.23
+ * @time: 11:30
*/
-
+
+ namespace wpsg;
+
?>
-
-<?php echo wpsg_drawForm_AdminboxStart(__('Produktvarianten', 'wpsg')); ?>
-
-<?php if (wpsg_isSizedInt($this->view['data']['id'])) { ?>
- <?php echo $this->view['wpsg_mod_productvariants']['html']; ?>
+<?php if (!wpsg_isSizedInt($this->view['data']['id'])) { ?>
+
+ <p><?php echo __('Bitte speichern Sie das Produkt zuerst.', 'wpsg'); ?></p>
+
+<?php } else {
+
+ /** @var \wpsg_product $oProduct */
+ $oProduct = \wpsg_product::getInstance(intval($this->view['data']['id']));
+
+ ?>
+
+ <?php echo wpsg_drawForm_AdminboxStart(__('Produktvarianten', 'wpsg')); ?>
+
+ <?php echo $this->view['wpsg_mod_productvariants']['html']; ?>
+ <a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants"><span class="wpsg-glyphicon glyphicon glyphicon-wrench"></span><?php echo __('Zur Konfiguration der Produktvarianten', 'wpsg'); ?></a>
+
+ <?php echo wpsg_drawForm_AdminboxEnd(); ?>
- <script type="text/javascript">/* <![CDATA[ */
+ <div id="wpsg_mod_productvars_combination">
+
+ <div v-if="loading" class="loading_layer">
+ <img class="loading" src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />
+ </div>
+
+ <div class="inner">
+ <div class="top_filter">
+ <div v-for="(variant, i) of arVariationen">
+ <select v-model="arFilter[i]">
+ <option :value="0">{{getVariantLabel(i)}} [ Alle ]</option>
+ <option :value="parseInt(variation)" v-for="(variation, j) of variant">{{getVariantLabel(i)}} [{{getVariationLabel(variation)}}]</option>
+ </select>
+ </div>
+ </div>
+ <div v-for="(combination, i) of arPossibleKeysFiltered" class="relative">
+ <div class="panel panel-default">
+ <div class="panel-heading clearfix">
+ <h3 class="panel-title">
+ {{combination.label}}
+ <span v-if="combination.id > 0" class="glyphicon glyphicon-pencil" @click.prevent="edit(combination)"></span>
+ <span v-else class="glyphicon glyphicon-plus" @click.prevent="add(combination)"></span>
+ </h3>
+ </div>
+ <div class="panel-body" v-if="combination.loaded">
+
+ <div v-if="combination.loading" class="loading_layer">
+ <img class="loading" src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />
+ </div>
+
+ <div class="form-group form-group-sm ">
+ <label class="col-sm-6 control-label" for="detailname">Artikelnummer</label>
+ <div class="col-sm-6">
+ <div class="wpsg_field_wrap">
+ <input type="text" class="form-control input-sm " autocomplete="off" placeholder="" v-model="combination.anr" />
+ </div>
+ </div>
+ <div class="clearfix wpsg_clear"></div>
+ </div>
+
+ <!-- EAN -->
+ <div class="form-group form-group-sm ">
+ <label class="col-sm-6 control-label" for="detailname">EAN (European Article Number)</label>
+ <div class="col-sm-6">
+ <div class="wpsg_field_wrap">
+ <input type="text" class="form-control input-sm " autocomplete="off" placeholder="" v-model="combination.ean" maxlength="13" />
+ </div>
+ </div>
+ <div class="clearfix wpsg_clear"></div>
+ </div>
+
+ <!-- GTIN -->
+ <div class="form-group form-group-sm ">
+ <label class="col-sm-6 control-label" for="detailname">GTIN (Global Trade Item Number)</label>
+ <div class="col-sm-6">
+ <div class="wpsg_field_wrap">
+ <input type="text" class="form-control input-sm " autocomplete="off" placeholder="" v-model="combination.gtin" />
+ </div>
+ </div>
+ <div class="clearfix wpsg_clear"></div>
+ </div>
+
+ <!-- MPN -->
+ <div class="form-group form-group-sm ">
+ <label class="col-sm-6 control-label" for="detailname">MPN (Manufacturer Part Number)</label>
+ <div class="col-sm-6">
+ <div class="wpsg_field_wrap">
+ <input type="text" class="form-control input-sm " autocomplete="off" placeholder="" v-model="combination.mpn" />
+ </div>
+ </div>
+ <div class="clearfix wpsg_clear"></div>
+ </div>
+
+ <!-- PZN -->
+ <div class="form-group form-group-sm ">
+ <label class="col-sm-6 control-label" for="detailname">PZN (Pharmazentralnummer)</label>
+ <div class="col-sm-6">
+ <div class="wpsg_field_wrap">
+ <input type="text" class="form-control input-sm " autocomplete="off" placeholder="" v-model="combination.pzn" />
+ </div>
+ </div>
+ <div class="clearfix wpsg_clear"></div>
+ </div>
+
+ <!-- SKU -->
+ <div class="form-group form-group-sm ">
+ <label class="col-sm-6 control-label" for="detailname">SKU (Stock Keeping Unit)</label>
+ <div class="col-sm-6">
+ <div class="wpsg_field_wrap">
+ <input type="text" class="form-control input-sm " autocomplete="off" placeholder="" v-model="combination.sku" />
+ </div>
+ </div>
+ <div class="clearfix wpsg_clear"></div>
+ </div>
+
+ <!-- UPC -->
+ <div class="form-group form-group-sm ">
+ <label class="col-sm-6 control-label" for="detailname">UPC (Universal Product Code)</label>
+ <div class="col-sm-6">
+ <div class="wpsg_field_wrap">
+ <input type="text" class="form-control input-sm " autocomplete="off" placeholder="" v-model="combination.upc" />
+ </div>
+ </div>
+ <div class="clearfix wpsg_clear"></div>
+ </div>
+
+ <!-- ISBN -->
+ <div class="form-group form-group-sm ">
+ <label class="col-sm-6 control-label" for="detailname">ISBN (International Standard Book Number)</label>
+ <div class="col-sm-6">
+ <div class="wpsg_field_wrap">
+ <input type="text" class="form-control input-sm " autocomplete="off" placeholder="" v-model="combination.isbn" />
+ </div>
+ </div>
+ <div class="clearfix wpsg_clear"></div>
+ </div>
+
+ <!-- ISSN -->
+ <div class="form-group form-group-sm ">
+ <label class="col-sm-6 control-label" for="detailname">ISSN (International Standard Serial Number)</label>
+ <div class="col-sm-6">
+ <div class="wpsg_field_wrap">
+ <input type="text" class="form-control input-sm " autocomplete="off" placeholder="" v-model="combination.issn" />
+ </div>
+ </div>
+ <div class="clearfix wpsg_clear"></div>
+ </div>
+
+ <!-- ISIN -->
+ <div class="form-group form-group-sm ">
+ <label class="col-sm-6 control-label" for="detailname">ISIN (International Securities Identification Number)</label>
+ <div class="col-sm-6">
+ <div class="wpsg_field_wrap">
+ <input type="text" class="form-control input-sm " autocomplete="off" placeholder="" v-model="combination.isin" />
+ </div>
+ </div>
+ <div class="clearfix wpsg_clear"></div>
+ </div>
+
+ <div class="mt-8 flex w-full justify-end">
+ <input type="submit" @click.prevent="save(combination)" class="button button-primary" value="speichern" />
+ </div>
+
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <script src="<?php echo WPSG_URL_CONTENT.'plugins/'.WPSG_FOLDERNAME.'/views/js/vue-3.2.47.global.min.js'; ?>"></script>
+ <script>
+
+ const ref = Vue.ref;
+ const computed = Vue.computed;
+ const onMounted = Vue.onMounted;
+
+ const app = Vue.createApp({
+ setup() {
+
+ const product_id = ref(<?php echo $oProduct->getId(); ?>);
+ const loading = ref(true);
+ const arFilter = ref(undefined);
+ const arPossibleKeys = ref(undefined);
+ const arVariant = ref(undefined);
+ const arVariantLabel = ref(undefined);
+ const arVariationen = ref(undefined);
+ const arVariationLabel = ref(undefined);
+
+ const arPossibleKeysFiltered = computed(() => {
+
+ let r = [];
+
+ if (!arPossibleKeys.value) return r;
+
+ for (let var_key of arPossibleKeys.value) {
+
+ const arKey = var_key.var_key.split('|');
+ const typedKey = {};
+
+ for (let i of arKey) {
+
+ const [var_id, vari_id] = i.split(':');
+
+ typedKey[var_id] = parseInt(vari_id);
+
+ }
+
+ let set = true;
+
+ for (let f in arFilter.value) {
+
+ if (arFilter.value[f] !== 0 && typedKey[f] !== arFilter.value[f]) {
+
+ set = false; break;
+
+ }
+
+ }
+
+ if (set) r.push(var_key);
+
+ }
+
+ return r;
+
+ });
+
+ const getVariantLabel = (var_id) => {
+
+ if (arVariantLabel.value[var_id.toString()] !== undefined) return arVariantLabel.value[var_id.toString()];
+ else '';
+
+ };
+ const getVariationLabel = (var_id) => {
+
+ if (arVariationLabel.value[var_id.toString()] !== undefined) return arVariationLabel.value[var_id.toString()];
+ else '';
+
+ };
+ const xhr = (action_do, data, cb_success) => {
+
+ const request = new XMLHttpRequest();
+
+ data.action_do = action_do;
+
+ request.open('POST', '<?php echo WPSG_URL_WP; ?>wp-admin/?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=combination&noheader=1', true);
+ request.setRequestHeader('Content-Type', 'application/json; charset=UTF-8');
+ request.onload = () => {
+
+ if (request.status >= 200 && request.status < 400) {
+
+ const response = JSON.parse(request.responseText);
+
+ cb_success(response);
+
+ } else {
+
+ console.error('Error: ' + request.statusText);
+
+ }
+
+ };
+
+ request.onerror = function() {
+
+ console.error('Error: ' + request.statusText);
+
+ };
+
+ request.send(JSON.stringify(data));
+
+ };
+ const save = (combination) => {
+
+ xhr('save', {
+ var_key: combination.var_key,
+ product_id: combination.product_id,
+ combination: combination
+ }, (response) => {
+
+ for (let i = 0; i < arPossibleKeys.value.length; i ++) {
+
+ const var_key = arPossibleKeys.value[i];
+
+ if (var_key.var_key === response.combination.var_key) {
+
+ arPossibleKeys.value[i] = response.combination;
+
+ }
+
+ }
+
+ });
+
+ combination.loading = true;
+
+ }
+ const updateCombinationData = () => {
+ xhr('getCombination', {
+ product_id: product_id.value
+ }, (response) => {
+
+ arFilter.value = response.arFilter;
+ arPossibleKeys.value = response.arPossibleKeys;
+ arVariant.value = response.arVariant;
+ arVariantLabel.value = response.arVariantLabel;
+ arVariationen.value = response.arVariationen;
+ arVariationLabel.value = response.arVariationLabel;
+
+ loading.value = false;
+
+ });
+
+ };
+ const add = (combination) => {
+
+ combination.loaded = true;
+ combination.loading = true;
+
+ xhr('add', {
+ var_key: combination.var_key,
+ product_id: product_id.value
+ }, (response) => {
+
+ for (let i = 0; i < arPossibleKeys.value.length; i ++) {
+
+ const var_key = arPossibleKeys.value[i];
+
+ if (var_key.var_key === response.combination.var_key) {
+
+ arPossibleKeys.value[i] = response.combination;
+
+ }
+
+ }
+
+ });
+
+ };
+ const edit = (combination) => {
+
+ combination.loaded = true;
+ combination.loading = true;
+
+ xhr('edit', {
+ var_key: combination.var_key,
+ product_id: product_id.value
+ }, (response) => {
+
+ for (let i = 0; i < arPossibleKeys.value.length; i ++) {
+
+ const var_key = arPossibleKeys.value[i];
+
+ if (var_key.var_key === response.combination.var_key) {
+
+ arPossibleKeys.value[i] = response.combination;
+
+ }
+
+ }
+
+ });
+
+ }
+
+ onMounted(() => {
+
+ // updateCombinationData();
+
+ });
+
+ return {
+ arFilter, arPossibleKeys, arVariant, arVariantLabel, arVariationen, arVariationLabel, product_id, loading,
+ getVariantLabel, getVariationLabel,
+ arPossibleKeysFiltered,
+ add, edit, save, updateCombinationData
+ };
+
+ }
+ }).mount('#wpsg_mod_productvars_combination');
+
+ window.wpsg_mod_productvariants = app;
+
jQuery(document).ready(function() {
-
+
wpsg_mod_productvariants_show(<?php echo $this->view['data']['id']; ?>);
} );
+
+ </script>
+
+ <style>
+
+ #wpsg_mod_productvars_combination { width:100%; position:relative; }
+ #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 .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; }
+ #wpsg_mod_productvars_combination > .inner { min-height:50px; width:100%; }
+ #wpsg_mod_productvars_combination .flex { display:flex; }
+ #wpsg_mod_productvars_combination .w-full { width:100%; }
+ #wpsg_mod_productvars_combination .justify-end { justify-content:flex-end; }
+ #wpsg_mod_productvars_combination .mt-4 { margin-top:1rem; }
+ #wpsg_mod_productvars_combination .relative { position:relative; }
+ #wpsg_mod_productvars_combination .mt-8 { margin-top:2rem; }
+
+ </style>
- /* ]]> */</script>
-
-<?php } else { ?>
-
- <p><?php echo __('Bitte speichern Sie das Produkt zuerst.', 'wpsg'); ?></p>
-
-<?php } ?>
-
-<a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants"><span class="wpsg-glyphicon glyphicon glyphicon-wrench"></span><?php echo __('Zur Konfiguration der Produktvarianten', 'wpsg'); ?></a>
-
-<?php echo wpsg_drawForm_AdminboxEnd(); ?>
\ No newline at end of file +<?php }
\ No newline at end of file diff --git a/views/mods/mod_productvariants/produkt_addedit_content_combination.phtml b/views/mods/mod_productvariants/produkt_addedit_content_combination.phtml deleted file mode 100644 index 00600ce..0000000 --- a/views/mods/mod_productvariants/produkt_addedit_content_combination.phtml +++ /dev/null @@ -1,305 +0,0 @@ -<?php - - declare(strict_types=1); - - /** - * Template für die Verwaltung der Produktvarianten innerhalb des Produktes - * @author: Daniel Schmitzer (daschmi@daschmi.de) - * @date: 20.04.23 - * @time: 11:30 - */ - - namespace wpsg; - - /** @var \wpsg_product $oProduct */ - $oProduct = \wpsg_product::getInstance(intval($this->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; } - - } - -?> - -<div id="wpsg_mod_productvars_combination"> - <div class="top_filter"> - <div v-for="(variant, i) of arVariationen"> - <select v-model="arFilter[i]"> - <option :value="0">{{getVariantLabel(i)}} [ Alle ]</option> - <option :value="parseInt(variation)" v-for="(variation, j) of variant">{{getVariantLabel(i)}} [{{getVariationLabel(variation)}}]</option> - </select> - </div> - </div> - <div v-for="(combination, i) of arPossibleKeysFiltered" class="relative"> - <div class="panel panel-default"> - <div class="panel-heading clearfix"> - <h3 class="panel-title"> - {{combination.label}} - <span v-if="combination.id > 0" class="glyphicon glyphicon-pencil" @click.prevent="edit(combination)"></span> - <span v-else class="glyphicon glyphicon-plus" @click.prevent="add(combination)"></span> - </h3> - </div> - <div class="panel-body" v-if="combination.loaded"> - - <div v-if="combination.loading" class="loading_layer"> - <img class="loading" src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" /> - </div> - - <div class="form-group form-group-sm "> - <label class="col-sm-6 control-label" for="detailname">Artikelnummer</label> - <div class="col-sm-6"> - <div class="wpsg_field_wrap"> - <input type="text" class="form-control input-sm " autocomplete="off" placeholder="" v-model="combination.anr"> - </div> - </div> - <div class="clearfix wpsg_clear"></div> - </div> - - <div class="mt-8 flex w-full justify-end"> - <input type="submit" @click.prevent="save(combination)" class="button button-primary" value="speichern" /> - </div> - - <pre class="mt-8">{{combination}}</pre> - - </div> - </div> - </div> -</div> - -<script src="<?php echo WPSG_URL_CONTENT.'plugins/'.WPSG_FOLDERNAME.'/views/js/vue-3.2.47.global.min.js'; ?>"></script> -<script> - - const ref = Vue.ref; - const computed = Vue.computed; - - const app = Vue.createApp({ - setup() { - - const product_id = ref(<?php echo $oProduct->getId(); ?>); - const arFilter = ref(<?php echo json_encode($arFilter); ?>); - const arPossibleKeys = ref(<?php echo json_encode($arPossibleKeys); ?>); - const arVariant = ref(<?php echo json_encode($arVariant); ?>); - const arVariantLabel = ref(<?php echo json_encode($arVariantLabel); ?>); - const arVariationen = ref(<?php echo json_encode($arVariationen); ?>); - const arVariationLabel = ref(<?php echo json_encode($arVariationLabel); ?>); - - const arPossibleKeysFiltered = computed(() => { - - let r = []; - - for (let var_key of arPossibleKeys.value) { - - const arKey = var_key.var_key.split('|'); - const typedKey = {}; - - for (let i of arKey) { - - const [var_id, vari_id] = i.split(':'); - - typedKey[var_id] = parseInt(vari_id); - - } - - let set = true; - - for (let f in arFilter.value) { - - if (arFilter.value[f] !== 0 && typedKey[f] !== arFilter.value[f]) { - - set = false; break; - - } - - } - - if (set) r.push(var_key); - - } - - return r; - - }); - - const getVariantLabel = (var_id) => { - - if (arVariantLabel.value[var_id.toString()] !== undefined) return arVariantLabel.value[var_id.toString()]; - else ''; - - }; - const getVariationLabel = (var_id) => { - - if (arVariationLabel.value[var_id.toString()] !== undefined) return arVariationLabel.value[var_id.toString()]; - else ''; - - }; - const xhr = (action_do, data, cb_success) => { - - const request = new XMLHttpRequest(); - - data.action_do = action_do; - - request.open('POST', '<?php echo WPSG_URL_WP; ?>wp-admin/?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=combination&noheader=1', true); - request.setRequestHeader('Content-Type', 'application/json; charset=UTF-8'); - request.onload = () => { - - if (request.status >= 200 && request.status < 400) { - - const response = JSON.parse(request.responseText); - - cb_success(response); - - } else { - - console.error('Error: ' + request.statusText); - - } - - }; - - request.onerror = function() { - - console.error('Error: ' + request.statusText); - - }; - - request.send(JSON.stringify(data)); - - }; - const save = (combination) => { - - xhr('save', { - var_key: combination.var_key, - product_id: combination.product_id, - combination: combination - }, (response) => { - - for (let i = 0; i < arPossibleKeys.value.length; i ++) { - - const var_key = arPossibleKeys.value[i]; - - if (var_key.var_key === response.combination.var_key) { - - arPossibleKeys.value[i] = response.combination; - - } - - } - - }); - - combination.loading = true; - - } - const add = (combination) => { - - combination.loaded = true; - combination.loading = true; - - xhr('add', { - var_key: combination.var_key, - product_id: product_id.value - }, (response) => { - - for (let i = 0; i < arPossibleKeys.value.length; i ++) { - - const var_key = arPossibleKeys.value[i]; - - if (var_key.var_key === response.combination.var_key) { - - arPossibleKeys.value[i] = response.combination; - - } - - } - - }); - - }; - const edit = (combination) => { - - combination.loaded = true; - combination.loading = true; - - xhr('edit', { - var_key: combination.var_key, - product_id: product_id.value - }, (response) => { - - for (let i = 0; i < arPossibleKeys.value.length; i ++) { - - const var_key = arPossibleKeys.value[i]; - - if (var_key.var_key === response.combination.var_key) { - - arPossibleKeys.value[i] = response.combination; - - } - - } - - }); - - } - - return { - arFilter, arPossibleKeys, arVariant, arVariantLabel, arVariationen, arVariationLabel, product_id, - getVariantLabel, getVariationLabel, - arPossibleKeysFiltered, - add, edit, save - }; - - } - }).mount('#wpsg_mod_productvars_combination'); - -</script> - -<style> - - #wpsg_mod_productvars_combination { width:100%; } - #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 .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(0, 0, 0, 0.5); display:flex; justify-content:center; align-items:center; } - #wpsg_mod_productvars_combination .flex { display:flex; } - #wpsg_mod_productvars_combination .w-full { width:100%; } - #wpsg_mod_productvars_combination .justify-end { justify-content:flex-end; } - #wpsg_mod_productvars_combination .mt-4 { margin-top:1rem; } - #wpsg_mod_productvars_combination .relative { position:relative; } - #wpsg_mod_productvars_combination .mt-8 { margin-top:2rem; } - -</style>
\ 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 @@ ?>
<?php echo wpsg_drawForm_Input('wpsg_mod_produktartikel[path]', __('URL Path Segment', 'wpsg'), wpsg_getStr($this->view['data']['post_name']), array('help' => 'wpsg_mod_produktartikel_url_path_seg')); ?>
-<?php if (wpsg_isSizedInt($this->get_option('wpsg_mod_produktartikel_ean'))) { ?>
-<?php echo wpsg_drawForm_Input('wpsg_mod_produktartikel[ean]', __('EAN', 'wpsg'), wpsg_getStr($this->view['data']['ean']), array('help' => 'wpsg_mod_produktartikel_ean')); ?>
-<?php } ?>
-
-<?php if (wpsg_isSizedInt($this->get_option('wpsg_mod_produktartikel_gtin'))) { ?>
-<?php echo wpsg_drawForm_Input('wpsg_mod_produktartikel[gtin]', __('GTIN', 'wpsg'), wpsg_getStr($this->view['data']['gtin']), array('help' => 'wpsg_mod_produktartikel_gtin')); ?>
-<?php } ?>
\ 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 @@ <br />
-<?php echo wpsg_drawForm_Checkbox('wpsg_mod_produktartikel_ean', __('Darstellung der EAN aktivieren', 'wpsg'), $this->get_option('wpsg_mod_produktartikel_ean'), array('help' => 'wpsg_mod_produktartikel_ean')); ?>
-<?php echo wpsg_drawForm_Checkbox('wpsg_mod_produktartikel_gtin', __('Darstellung der GTIN aktivieren', 'wpsg'), $this->get_option('wpsg_mod_produktartikel_gtin'), array('help' => 'wpsg_mod_produktartikel_gtin')); ?>
-
-<br />
-
<?php echo wpsg_drawForm_Checkbox('wpsg_mod_produktartikel_cat', __('Kategorie in Produktübersicht (Backend) anzeigen', 'wpsg'), $this->get_option('wpsg_mod_produktartikel_cat'), array('help' => 'wpsg_mod_produktartikel_cat')); ?>
<div id="wpsg_mod_produktartikel_cat_1">
<?php echo wpsg_drawForm_Checkbox('wpsg_mod_produktartikel_cat_first_level', __('Nur erste Ebene', 'wpsg'), $this->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 {
|
