summaryrefslogtreecommitdiff
path: root/views/mods
diff options
context:
space:
mode:
Diffstat (limited to 'views/mods')
-rw-r--r--views/mods/mod_productgroups/add.phtml1
-rw-r--r--views/mods/mod_productgroups/index.phtml4
-rw-r--r--views/mods/mod_productgroups/list.phtml36
-rw-r--r--views/mods/mod_productgroups/show_2.phtml6
-rw-r--r--views/mods/mod_productvariants/admin_edit.phtml8
-rw-r--r--views/mods/mod_productvariants/produkt_addedit_content.phtml582
-rw-r--r--views/mods/mod_rechnungen/invoice_pdf.phtml6
7 files changed, 342 insertions, 301 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 @@
<?php echo wpsg_drawForm_Select('template_file', __('Template', 'wpsg'), $this->view['templates'], $this->view['data']['template_file']); ?>
<?php echo wpsg_drawForm_Select('infopage', __('Info Seite', 'wpsg'), $this->view['pages'], $this->view['data']['infopage']); ?>
+ <?php echo wpsg_drawForm_Input('pos', __('Positionsnummer (Sortierung, aufsteigend)', 'wpsg'), $this->view['data']['pos']); ?>
<div class="form-group form-group-sm ">
<label class="col-sm-6 control-label"><?php echo __('Produktgruppenbild', 'wpsg'); ?></label>
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 @@
<th class="wpsg_pic_col"></th>
<th class="wpsg_order col_name" data-order="nr"><?php echo __("Name", 'wpsg'); ?></th>
<th class="wpsg_order col_template" data-order="template"><?php echo __("Template", 'wpsg'); ?></th>
+ <th class="wpsg_order col_pos" data-order="template"><?php echo __("Position", 'wpsg'); ?></th>
<th class="wpsg_order col_products" data-order="products"><?php echo __("Produkte", 'wpsg'); ?></th>
</tr>
</thead>
@@ -123,6 +124,9 @@
<td class="col_template">
<?php echo (($pg->template_file == "0")?'Individuelle Produkttemplates':$pg->template_file); ?>
</td>
+ <td class="col_pos">
+ <?php echo $pg->pos; ?>
+ </td>
<td class="col_products">
<?php echo $pg->countProducts(); ?>
</td>
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 @@
?>
-<?php $c = 0; foreach ((array)$this->view['data'] as $k => $g) { ?>
+<?php $c = 0; foreach ((array)$this->view['data'] as $k => $g) {
+
+ $oProductgroup = wpsg_productgroup::getInstance(intval($k));
+
+ ?>
<?php //wpsg_debug($g) ?>
-<div class="wpsg_pgruppen_list_row">
+<div class="wpsg_pgruppen_list_row <?php
+
+ echo (($oProductgroup->hasActiveDiscount())?'active_discount':'');
+
+ ?>">
<div class="wpsg_pgruppen_list_titel">
<a href="<?php echo WPSG_URL_WP ?>?page_id=<?php echo get_the_ID(); ?>&show=<?php echo $k ?>">
<h2><?php echo $g['pgruppe_name'] ?></h2>
@@ -35,17 +43,19 @@
<?php } else { ?>
- <?php $image = array_rand($g['produkte'][$i]['bilder']); ?>
- <?php if ($image >= 0 && is_int($image)) { ?>
- <div class="wpsg_pgruppen_list_image">
-
- <a href="<?php echo $g['produkte'][$i]['url'] ?>">
- <?php echo wp_get_attachment_image($g['produkte'][$i]['bilder'][0], 'thumbnail', false, array()); ?>
- </a>
-
- </div>
- <?php } ?>
-
+ <?php if (sizeof($g['produkte'][$i]['bilder']??[]) > 0) { ?>
+ <?php $image = array_rand($g['produkte'][$i]['bilder']); ?>
+ <?php if ($image >= 0 && is_int($image)) { ?>
+ <div class="wpsg_pgruppen_list_image">
+
+ <a href="<?php echo $g['produkte'][$i]['url'] ?>">
+ <?php echo wp_get_attachment_image($g['produkte'][$i]['bilder'][0], 'thumbnail', false, array()); ?>
+ </a>
+
+ </div>
+ <?php } ?>
+ <?php } ?>
+
<?php } ?>
<?php } ?>
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 <?php
+
+ echo (($oProductgroup->hasActiveDiscount())?'active_discount':'');
+
+ ?>">
<div class="title"><?php echo $oProductgroup->getLabel(); ?></div>
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 @@
<?php $colspan += 3; ?>
<?php if (wpsg_isSizedInt($this->view['product_id'])) { $colspan += 2; ?>
- <th class="col_artnr"><?php echo __('Artikelnummer', 'wpsg'); ?></th>
+ <!--<th class="col_artnr"><?php echo __('Artikelnummer', 'wpsg'); ?></th>-->
<th class="col_price"><?php echo __('Preis', 'wpsg'); ?></th>
<?php if ($this->hasMod('wpsg_mod_stock')) { ?>
@@ -170,7 +170,7 @@
<td class="col_shortname"><span class="wpsg_editable" id="productvariation_shortname_<?php echo $vari['id']; ?>"><?php echo wpsg_hspc($vari['shortname']); ?></span></td>
<?php if (wpsg_isSizedInt($this->view['product_id'])) { ?>
- <td class="col_artnr"><span class="wpsg_editable" id="productvariation_anr_<?php echo $vari['id']; ?>"><?php echo wpsg_hspc($vari['anr']); ?></span></td>
+ <!--<td class="col_artnr"><span class="wpsg_editable" id="productvariation_anr_<?php echo $vari['id']; ?>"><?php echo wpsg_hspc($vari['anr']); ?></span></td>-->
<td class="col_price"><span class="wpsg_editable" id="productvariation_price_<?php echo $vari['id']; ?>"><?php echo wpsg_hspc(wpsg_ff($vari['price'], $this->get_option('wpsg_currency'))); ?></span></td>
<?php if ($this->hasMod('wpsg_mod_stock')) { ?>
@@ -316,7 +316,7 @@
</div>
<?php } ?>
- <?php if (wpsg_isSizedInt($this->view['product_id'])) { ?>
+ <?php /* if (wpsg_isSizedInt($this->view['product_id'])) { ?>
<div style="margin-top:0.25rem;">
<span>EAN:
<span title="<?php echo __('EAN der Produktvariation', 'wpsg'); ?>" class="wpsg_editable" id="productvariation_ean_<?php echo $vari['id']; ?>"><?php echo $vari['ean']??''; ?></span>
@@ -333,7 +333,7 @@
</script>
</div>
- <?php } ?>
+ <?php } */ ?>
<script>
diff --git a/views/mods/mod_productvariants/produkt_addedit_content.phtml b/views/mods/mod_productvariants/produkt_addedit_content.phtml
index 50de7b4..657cd21 100644
--- a/views/mods/mod_productvariants/produkt_addedit_content.phtml
+++ b/views/mods/mod_productvariants/produkt_addedit_content.phtml
@@ -51,8 +51,13 @@
<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>
+ <div class="right">
+ <a :href="combination.url" target="_blank" class="url" title="<?php echo __('Produktvariante im Frontend ansehen', 'wpsg'); ?>">
+ <span class="glyphicon glyphicon-new-window"></span>
+ </a>
+ <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>
+ </div>
</h3>
</div>
<div class="panel-body" v-if="combination.loaded">
@@ -62,113 +67,76 @@
</div>
<div class="form-group form-group-sm ">
- <label class="col-sm-6 control-label" for="detailname">Artikelnummer</label>
+ <label class="col-sm-6 control-label" for="name">Produktname</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" />
+ <input type="text"
+ @keydown.enter.prevent
+ class="form-control input-sm " autocomplete="off" placeholder="" v-model="combination.name" />
</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>
+ <label class="col-sm-6 control-label" for="detailname">Produktname (Detail)</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" />
+ <input type="text"
+ @keydown.enter.prevent
+ class="form-control input-sm " autocomplete="off" placeholder="" v-model="combination.detailname" />
</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>
+ <label class="col-sm-6 control-label" for="anr">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.gtin" />
+ <input type="text"
+ @keydown.enter.prevent
+ class="form-control input-sm" autocomplete="off" placeholder="" v-model="combination.anr" />
</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" />
+
+ <!-- Productcodes -->
+ <template v-if="codeKeyNotSet(combination).length > 0">
+ <div class="form-group form-group-sm has-feedback">
+ <label class="col-sm-6 control-label" for="metaean">Code hinzufügen</label>
+ <div class="col-sm-6">
+ <div class="wpsg_field_wrap">
+ <select class="form-control input-sm" v-model="combination.add_code_key">
+ <option v-for="(code_key, i) of codeKeyNotSet(combination)" :value="code_key">{{combination.arProductCodes[code_key].label}}</option>
+ </select>
+ <a @click.stop.prevent="codeKeyAdd(combination)" href="#" class="glyphicon glyphicon glyphicon-plus form-control-feedback" aria-hidden="true" style="pointer-events: auto;"></a>
+ </div>
</div>
+ <div class="clearfix wpsg_clear"></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" />
+ <hr />
+ </template>
+
+ <div class="code_wrap">
+ <template v-for="(code, i) of combination.arProductCodes">
+ <div class="form-group form-group-sm has-feedback" v-if="code.set === true">
+ <label class="col-sm-6 control-label" for="metaean">{{code.label}}</label>
+ <div class="col-sm-6">
+ <div class="wpsg_field_wrap">
+ <input type="text" class="form-control input-sm" v-model="code.code"
+ @keydown.enter.prevent
+ />
+ <a @click.stop.prevent="codeKeyRemove(combination, code.code_key)" href="#" class="glyphicon glyphicon glyphicon-trash form-control-feedback" aria-hidden="true" style="pointer-events: auto;"></a>
+ </div>
+ </div>
+ <div class="clearfix wpsg_clear"></div>
</div>
- </div>
- <div class="clearfix wpsg_clear"></div>
+ </template>
</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>
+ <!--<pre>{{combination}}</pre>-->
<div class="mt-8 flex w-full justify-end">
<input type="submit" @click.prevent="save(combination)" class="button button-primary" value="speichern" />
@@ -180,226 +148,277 @@
</div>
</div>
+ <?php $GLOBALS['wpsg_vue_3.2.47_loaded'] = ($GLOBALS['wpsg_vue_3.2.47_loaded']??0) + 1; if ($GLOBALS['wpsg_vue_3.2.47_loaded'] <= 1) { ?>
<script src="<?php echo WPSG_URL_CONTENT.'plugins/'.WPSG_FOLDERNAME.'/views/js/vue-3.2.47.global.min.js'; ?>"></script>
+ <?php } ?>
+
<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;
-
+ (() => {
+
+ 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);
+
}
-
- 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 {
-
+
+ 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));
+
};
-
- request.onerror = function() {
-
- console.error('Error: ' + request.statusText);
-
+ 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;
+
+ });
+
};
-
- 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;
-
+ 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;
+
+ }
+
}
-
- }
-
- });
-
- combination.loading = true;
-
- }
- const updateCombinationData = () => {
- xhr('getCombination', {
- product_id: product_id.value
- }, (response) => {
+ });
+
+ };
+ 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;
+
+ }
+
+ }
+
+ });
+
+ };
+ const codeKeyNotSet = (combination) => {
- arFilter.value = response.arFilter;
- arPossibleKeys.value = response.arPossibleKeys;
- arVariant.value = response.arVariant;
- arVariantLabel.value = response.arVariantLabel;
- arVariationen.value = response.arVariationen;
- arVariationLabel.value = response.arVariationLabel;
+ let r = [];
- loading.value = false;
+ for (let code_key in combination.arProductCodes) {
- });
-
- };
- const add = (combination) => {
-
- combination.loaded = true;
- combination.loading = true;
-
- xhr('add', {
- var_key: combination.var_key,
- product_id: product_id.value
- }, (response) => {
+ if (combination.arProductCodes[code_key].set !== true) r.push(code_key);
- 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 r;
+
+ };
+ const codeKeyAdd = (combination) => {
+
+ const add_code_key = combination.add_code_key;
+
+ if (add_code_key !== undefined && codeKeyNotSet(combination).includes(add_code_key)) {
+
+ combination.arProductCodes[add_code_key].set = true;
+ combination.add_code_key = undefined;
+
}
+ };
+ const codeKeyRemove = (combination, code_key_remove) => {
+
+ combination.arProductCodes[code_key_remove].set = false;
+
+ }
+
+ onMounted(() => {
+
+ // updateCombinationData();
+
});
-
+
+ return {
+ arFilter,
+ arPossibleKeys,
+ arVariant,
+ arVariantLabel,
+ arVariationen,
+ arVariationLabel,
+ product_id,
+ loading,
+ getVariantLabel,
+ getVariationLabel,
+ codeKeyNotSet, codeKeyAdd, codeKeyRemove,
+ arPossibleKeysFiltered,
+ add,
+ edit,
+ save,
+ updateCombinationData
+ };
+
}
-
- 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']; ?>);
-
- } );
+ }).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>
@@ -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()));