From 26a7ba1e072e7420618ab3c0d3e61027ae781fce Mon Sep 17 00:00:00 2001 From: hartmut Date: Thu, 30 Mar 2017 08:51:31 +0000 Subject: Korrektur Varianten git-svn-id: https://[internal]/wordpress/plugins/wpsg4@6165 0d5edaf7-2b12-4e95-93f4-047927463d4b --- views/mods/mod_deliverynote/deliverynote_pdf.phtml | 9 +-- views/mods/mod_kundenverwaltung/order.phtml | 2 +- views/mods/mod_productfilter/settings_edit.phtml | 4 +- views/mods/mod_productvariants/admin_edit.phtml | 32 +++++++++++ views/mods/mod_productvariants/basket_row.phtml | 23 ++++++++ views/mods/mod_productvariants/frontend.js | 67 ++++++++++++++++++++++ views/mods/mod_productvariants/produkt.phtml | 7 ++- views/mods/mod_productvariants/settings_edit.phtml | 1 + views/mods/mod_productvariants/stock2.phtml | 59 ------------------- .../mods/mod_productvariants/stockVarianten.phtml | 59 ------------------- views/mods/mod_rechnungen/accounting_pdf.phtml | 4 +- views/mods/mod_rechnungen/invoice_pdf.phtml | 4 +- views/mods/mod_request/requestmail.phtml | 2 +- views/mods/mod_request/requestmail_html.phtml | 2 +- views/mods/mod_request/requestpage.phtml | 2 +- 15 files changed, 142 insertions(+), 135 deletions(-) create mode 100644 views/mods/mod_productvariants/basket_row.phtml delete mode 100644 views/mods/mod_productvariants/stock2.phtml delete mode 100644 views/mods/mod_productvariants/stockVarianten.phtml (limited to 'views/mods') diff --git a/views/mods/mod_deliverynote/deliverynote_pdf.phtml b/views/mods/mod_deliverynote/deliverynote_pdf.phtml index a644dca..3a0d1b5 100644 --- a/views/mods/mod_deliverynote/deliverynote_pdf.phtml +++ b/views/mods/mod_deliverynote/deliverynote_pdf.phtml @@ -162,10 +162,10 @@ } /* - if ($this->hasMod('wpsg_mod_varianten') && isset($p['mod_vp_varkey'])) + if ($this->hasMod('wpsg_mod_productvariants') && isset($p['mod_vp_varkey'])) { - $variante = $this->callMod('wpsg_mod_varianten', 'getVariantenInfoArray', array($p['mod_vp_varkey'])); + $variante = $this->callMod('wpsg_mod_productvariants', 'getVariantenInfoArray', array($p['mod_vp_varkey'])); $anr = $variante['akey']; } @@ -300,10 +300,11 @@ /** * Variante ? */ - if ($this->get_option("wpsg_mod_deliverynote_pdf_varianten") == "1" && preg_match('/vp_(.*)/', $p['productkey'])) + //$p['productkey'] = 'pv_6|4:1|7:3'; + if ($this->get_option("wpsg_mod_deliverynote_pdf_varianten") == "1" && preg_match('/pv_(.*)/', $p['productkey'])) { - $variInfo = $this->callMod('wpsg_mod_varianten', 'getVariantenInfoArray', array($p['productkey'])); + $variInfo = $this->callMod('wpsg_mod_productvariants', 'getVariantenInfoArray', array($p['productkey'])); $height += $pdf->wpsg_MultiCell($prod_left + 10, $prod_top + $height + $offset - 1.5, 5, wpsg_translate(__('Variante: #1#', 'wpsg'), $variInfo['key']), 0, 'L', 0, $produkt_text_cell_width); diff --git a/views/mods/mod_kundenverwaltung/order.phtml b/views/mods/mod_kundenverwaltung/order.phtml index 59853e9..1b3f8bb 100644 --- a/views/mods/mod_kundenverwaltung/order.phtml +++ b/views/mods/mod_kundenverwaltung/order.phtml @@ -45,7 +45,7 @@ getProductName($this->getProduktID($p['id']), true); ?>
: - hasMod('wpsg_mod_varianten') && wpsg_isSizedString($p['mod_vp_varkey'])) { $arVarInfo = $this->callMod('wpsg_mod_varianten', 'getVariantenInfoArray', array($p['mod_vp_varkey'])); ?> + hasMod('wpsg_mod_productvariants') && wpsg_isSizedString($p['mod_vp_varkey'])) { $arVarInfo = $this->callMod('wpsg_mod_productvariants', 'getVariantenInfoArray', array($p['mod_vp_varkey'])); ?>
: hasMod('wpsg_mod_downloadplus')) { ?> diff --git a/views/mods/mod_productfilter/settings_edit.phtml b/views/mods/mod_productfilter/settings_edit.phtml index 8fc7f53..05f2c42 100644 --- a/views/mods/mod_productfilter/settings_edit.phtml +++ b/views/mods/mod_productfilter/settings_edit.phtml @@ -45,7 +45,7 @@
-hasMod('wpsg_mod_varianten')) { ?> +hasMod('wpsg_mod_productvariants')) { ?>
@@ -53,7 +53,7 @@
view['wpsg_mod_productfilter']['arVarianten'])) { ?> - Variantenverwaltung Ihre Varianten.', 'wpsg'), WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_varianten'); ?> + Variantenverwaltung Ihre Varianten.', 'wpsg'), WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants'); ?> view['wpsg_mod_productfilter']['arVarianten'] as $var_name => $set) { $index ++; ?> $var_name, 'id' => 'wpsg_mod_productfilter_varianten_'.$index)); ?> diff --git a/views/mods/mod_productvariants/admin_edit.phtml b/views/mods/mod_productvariants/admin_edit.phtml index d0434d1..62636c6 100644 --- a/views/mods/mod_productvariants/admin_edit.phtml +++ b/views/mods/mod_productvariants/admin_edit.phtml @@ -27,6 +27,14 @@ + + hasMod('wpsg_mod_weight')) { ?> + + + hasMod('wpsg_mod_fuellmenge')) { ?> + + + view['product_id']) || wpsg_isSizedInt($this->view['variant']['product_id'])) { $colspan ++; ?> @@ -106,6 +114,22 @@ } }); + jQuery('#productvariation_weight_').wpsg_editable('wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1', { + submitdata: { + field: 'vari_weight', + product_id: jQuery('#wpsg_mod_productvariants_product_id').val(), + field_id: '' + } + }); + + jQuery('#productvariation_fmenge_').wpsg_editable('wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1', { + submitdata: { + field: 'vari_fmenge', + product_id: jQuery('#wpsg_mod_productvariants_product_id').val(), + field_id: '' + } + }); + /* ]]> */ @@ -119,6 +143,14 @@ get_option('wpsg_currency'))); ?> + + hasMod('wpsg_mod_weight')) { ?> + + + hasMod('wpsg_mod_fuellmenge')) { ?> + + + view['product_id']) || wpsg_isSizedInt($this->view['variant']['product_id'])) { ?> diff --git a/views/mods/mod_productvariants/basket_row.phtml b/views/mods/mod_productvariants/basket_row.phtml new file mode 100644 index 0000000..ba8063e --- /dev/null +++ b/views/mods/mod_productvariants/basket_row.phtml @@ -0,0 +1,23 @@ + +view['variante']) ?> + + : + + + view['variante'] as $vari => $value) { ?> + + : ; ; get_option('wpsg_currency') ?> +
+ + + + view['variante']['key']; ?> + + + \ No newline at end of file diff --git a/views/mods/mod_productvariants/frontend.js b/views/mods/mod_productvariants/frontend.js index a6d62fa..836bbdc 100644 --- a/views/mods/mod_productvariants/frontend.js +++ b/views/mods/mod_productvariants/frontend.js @@ -1,4 +1,71 @@ + var wpsg_vp_vari = new Array(); + + function wpsg_vp_switch(product_id, product_index) + { + + var var_key = 'pv_' + product_id + "|"; + //alert('Länge: ' + wpsg_vp_vari[product_id].length); + + for (var i = 0; i < wpsg_vp_vari[product_id].length; i ++) + { + + vkey1 = i + ":"; + vkey2 = ''; + + if (wpsg_vp_vari[product_id][i] == "select") + { + vkey2 = jQuery('#wpsg_produktform_' + product_index + ' .wpsg_produkt_' + product_id + " #wpsg_vpfield_" + product_id + "_" + i).val(); + } + else if (wpsg_vp_vari[product_id][i] == "radio") + { + vkey2 = jQuery('#wpsg_produktform_' + product_index + ' .wpsg_produkt_' + product_id + ' input[name="wpsg_vp[' + i + ']"]:checked').val(); + } + else if (wpsg_vp_vari[product_id][i] == "checkbox") + { + vkey2 = jQuery('#wpsg_produktform_' + product_index + ' .wpsg_produkt_' + product_id + ' input[name="wpsg_vp[' + i + ']"]:checked').length; + } + else if (wpsg_vp_vari[product_id][i] == "image") + { + vkey2 = jQuery('#wpsg_produktform_' + product_index + ' .wpsg_produkt_' + product_id + ' .wpsg_mod_productvariants_imageselect_' + i + ' .akt').attr("data-wpsg-id"); + } + + if (vkey2 != '') { + if (wpsg_vp_vari[product_id][i] == "image") + jQuery('#wpsg_vp_' + i).val(vkey2); + var_key += vkey1 + vkey2; + if (i < (wpsg_vp_vari[product_id].length - 1)) var_key += "|"; + } + } + + //console.log(jQuery('#wpsg_produktform_' + product_index).serialize()); + //console.log(var_key); + //return; + + jQuery('#wpsg_produktform_' + product_index).append('
' + wpsg_ajax.label_pleasewait + '
'); + + jQuery.ajax( { + 'url': wpsg_ajax.ajaxurl, + 'method': 'get', + 'data': { + 'action': 'wpsg_productvariants_switch', + 'wpsg_post_id': jQuery('#wpsg_produktform_' + product_index + ' input[name="wpsg_post_id"]').val(), + 'quantity': jQuery('#wpsg_menge_' + product_index).val(), + 'template': jQuery('#wpsg_produktform_' + product_index + ' input[name="wpsg[template]"]').val(), + 'referer': jQuery('#wpsg_produktform_' + product_index + ' input[name="myReferer"]').val(), + 'form_data': jQuery('#wpsg_produktform_' + product_index).serialize(), + 'product_key': var_key, + 'product_index': product_index + }, + 'success': function(data) { + + jQuery('#wpsg_produktform_' + product_index).replaceWith(data); + + } + } ); + + } // function wpsg_vp_switch(produkt_id) + function wpsg_mod_productvariants_reload(event) { diff --git a/views/mods/mod_productvariants/produkt.phtml b/views/mods/mod_productvariants/produkt.phtml index 7225c8b..602731a 100644 --- a/views/mods/mod_productvariants/produkt.phtml +++ b/views/mods/mod_productvariants/produkt.phtml @@ -18,7 +18,8 @@ foreach ($this->view['data']['vp_data'] as $k => $var) { $kk++; - if ($var['active'] == "1") { + //if ($var['active'] == "1") + { $vAktiv = true; ?> @@ -110,8 +111,8 @@ hasMod('wpsg_mod_produktbilder')) { ?> -
- +
+ $vari) { $kkv++; if ($vari['active'] == '1' && (!$this->hasMod('wpsg_mod_stock') || $vari['stock'] > 0)) { ?> diff --git a/views/mods/mod_productvariants/settings_edit.phtml b/views/mods/mod_productvariants/settings_edit.phtml index 3896830..d4ad6b5 100644 --- a/views/mods/mod_productvariants/settings_edit.phtml +++ b/views/mods/mod_productvariants/settings_edit.phtml @@ -20,6 +20,7 @@
get_option('wpsg_mod_productvariants')); ?> + get_option('wpsg_vp_detailview'), array('help' => 'wpsg_vp_detailview')); ?>
diff --git a/views/mods/mod_productvariants/stock2.phtml b/views/mods/mod_productvariants/stock2.phtml deleted file mode 100644 index 5130d87..0000000 --- a/views/mods/mod_productvariants/stock2.phtml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - \ No newline at end of file diff --git a/views/mods/mod_productvariants/stockVarianten.phtml b/views/mods/mod_productvariants/stockVarianten.phtml deleted file mode 100644 index 737ea27..0000000 --- a/views/mods/mod_productvariants/stockVarianten.phtml +++ /dev/null @@ -1,59 +0,0 @@ - - -view['arVariant'])) { ?> - - - - - view['arVariant'] as $var) { ?> - - - - - - - - - - - - - - - - - - -
- -
- - - - \ No newline at end of file diff --git a/views/mods/mod_rechnungen/accounting_pdf.phtml b/views/mods/mod_rechnungen/accounting_pdf.phtml index ccd280c..41c9b27 100644 --- a/views/mods/mod_rechnungen/accounting_pdf.phtml +++ b/views/mods/mod_rechnungen/accounting_pdf.phtml @@ -347,10 +347,10 @@ /** * Variante ? */ - if (preg_match('/vp_(.*)/', $p['productkey'])) + if (preg_match('/pv_(.*)/', $p['productkey'])) { - $variInfo = $this->callMod('wpsg_mod_varianten', 'getVariantenInfoArray', array($p['productkey'])); + $variInfo = $this->callMod('wpsg_mod_productvariants', 'getVariantenInfoArray', array($p['productkey'])); $height += $pdf->wpsg_MultiCell($prod_left + 10, $prod_top + $height + $offset - 0.5, 5, wpsg_translate(__('Variante: #1#', 'wpsg'), $variInfo['key']), 0, 'L', 0, $produkt_text_cell_width); diff --git a/views/mods/mod_rechnungen/invoice_pdf.phtml b/views/mods/mod_rechnungen/invoice_pdf.phtml index 25cbfdb..b9a1b5d 100644 --- a/views/mods/mod_rechnungen/invoice_pdf.phtml +++ b/views/mods/mod_rechnungen/invoice_pdf.phtml @@ -347,10 +347,10 @@ /** * Variante ? */ - if (preg_match('/vp_(.*)/', $p['productkey'])) + if (preg_match('/pv_(.*)/', $p['productkey'])) { - $variInfo = $this->callMod('wpsg_mod_varianten', 'getVariantenInfoArray', array($p['productkey'])); + $variInfo = $this->callMod('wpsg_mod_productvariants', 'getVariantenInfoArray', array($p['productkey'])); $height += $pdf->wpsg_MultiCell($prod_left + 10, $prod_top + $height + $offset - 0.5, 5, wpsg_translate(__('Variante: #1#', 'wpsg'), $variInfo['key']), 0, 'L', 0, $produkt_text_cell_width); diff --git a/views/mods/mod_request/requestmail.phtml b/views/mods/mod_request/requestmail.phtml index 3b9d411..0356a2a 100644 --- a/views/mods/mod_request/requestmail.phtml +++ b/views/mods/mod_request/requestmail.phtml @@ -26,7 +26,7 @@ get_option('wpsg_currency')), 15); ?> -hasMod('wpsg_mod_varianten') && $this->callMod('wpsg_mod_varianten', 'isVariantsProductKey', array($request_product['product_key']))) { ?> +hasMod('wpsg_mod_productvariant') && $this->callMod('wpsg_mod_productvariants', 'isVariantsProductKey', array($request_product['product_key']))) { ?> : diff --git a/views/mods/mod_request/requestmail_html.phtml b/views/mods/mod_request/requestmail_html.phtml index 744afd3..daf3061 100644 --- a/views/mods/mod_request/requestmail_html.phtml +++ b/views/mods/mod_request/requestmail_html.phtml @@ -31,7 +31,7 @@ - hasMod('wpsg_mod_varianten') && $this->callMod('wpsg_mod_varianten', 'isVariantsProductKey', array($request_product['product_key']))) { ?> + hasMod('wpsg_mod_productvariants') && $this->callMod('wpsg_mod_productvariants', 'isVariantsProductKey', array($request_product['product_key']))) { ?> : diff --git a/views/mods/mod_request/requestpage.phtml b/views/mods/mod_request/requestpage.phtml index 47a4a89..af6396d 100644 --- a/views/mods/mod_request/requestpage.phtml +++ b/views/mods/mod_request/requestpage.phtml @@ -139,7 +139,7 @@ - hasMod('wpsg_mod_varianten') && $this->callMod('wpsg_mod_varianten', 'isVariantsProductKey', array($request_product['product_key']))) { ?> + hasMod('wpsg_mod_productvariants') && $this->callMod('wpsg_mod_productvariants', 'isVariantsProductKey', array($request_product['product_key']))) { ?> : -- cgit v1.2.3