diff options
| author | Daniel Schmitzer <noreply@maennchen1.de> | 2016-05-18 15:51:59 +0000 |
|---|---|---|
| committer | Daniel Schmitzer <noreply@maennchen1.de> | 2016-05-18 15:51:59 +0000 |
| commit | fa949a5f112cc861fb518f6459f2bd4c7a22159b (patch) | |
| tree | e9fdc3a288cef4820b7d0ff73cf2561400e656e5 /views/mods/mod_productvariants | |
| parent | f7eb12e8cd86e542225df8244aa7e7df6d28c19a (diff) | |
- Neues Variantenmodul
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@5488 0d5edaf7-2b12-4e95-93f4-047927463d4b
Diffstat (limited to 'views/mods/mod_productvariants')
| -rw-r--r-- | views/mods/mod_productvariants/admin_edit.phtml | 172 | ||||
| -rw-r--r-- | views/mods/mod_productvariants/admin_html.phtml | 226 | ||||
| -rw-r--r-- | views/mods/mod_productvariants/admin_show.phtml | 102 | ||||
| -rw-r--r-- | views/mods/mod_productvariants/produkt_addedit_content.phtml | 33 | ||||
| -rw-r--r-- | views/mods/mod_productvariants/settings_edit.phtml | 22 |
5 files changed, 555 insertions, 0 deletions
diff --git a/views/mods/mod_productvariants/admin_edit.phtml b/views/mods/mod_productvariants/admin_edit.phtml new file mode 100644 index 0000000..4896638 --- /dev/null +++ b/views/mods/mod_productvariants/admin_edit.phtml @@ -0,0 +1,172 @@ +<?php
+
+ /**
+ * Template um eine Variante zu bearbeiten
+ */
+
+?>
+
+<input type="hidden" id="wpsg_mod_productvariants_product_id" value="<?php echo $this->view['product_id']; ?>" />
+<input type="hidden" id="wpsg_mod_productvariants_var_id" value="<?php echo $this->view['variant']['id']; ?>" />
+
+<?php if (wpsg_isSizedArray($this->view['arVariation'])) { ?>
+
+ <table class="table wpsg_mod_productvariants_table_variation">
+ <thead>
+ <tr>
+
+ <?php if (wpsg_isSizedInt($this->view['product_id'])) { ?>
+ <th class="col_active"></th>
+ <?php } ?>
+
+ <th class="col_id"><?php echo __('Id', 'wpsg'); ?></th>
+ <th class="col1"><?php echo __('Name', 'wpsg'); ?></th>
+
+ <?php if (wpsg_isSizedInt($this->view['product_id'])) { ?>
+ <th class="col_artnr"><?php echo __('Artikelnummer', 'wpsg'); ?></th>
+ <th class="col_price"><?php echo __('Preis', 'wpsg'); ?></th>
+ <th class="col_stock"><?php echo __('Lagerbestand', 'wpsg'); ?></th>
+ <?php } else { ?>
+ <th class="col_action"></th>
+ <?php } ?>
+
+ </tr>
+ </thead>
+ <?php $i = 0; foreach ($this->view['arVariation'] as $vari) { $i ++; ?>
+ <tbody id="vari_<?php echo $vari['id']; ?>">
+ <tr>
+
+ <?php if (wpsg_isSizedInt($this->view['product_id'])) { ?>
+ <td class="col_active">
+ <input type="checkbox" id="productvariation_active_<?php echo $vari['id']; ?>" name="active" value="1" <?php echo ((wpsg_isSizedString($vari['active'], '1'))?'checked="checked"':''); ?> />
+ </td>
+ <?php } ?>
+
+ <td class="col_id">
+ <?php echo $vari['id']; ?>
+ <script type="text/javascript">/* <![CDATA[ */
+
+ <?php if (!wpsg_isSizedInt($this->view['product_id'])) { ?>
+ jQuery('#productvariation_name_<?php echo $vari['id']; ?>').wspg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1', {
+ submitdata: {
+ field: 'vari_name',
+ field_id: '<?php echo $vari['id']; ?>'
+ }
+ });
+ <?php } else { ?>
+
+ jQuery('#productvariation_active_<?php echo $vari['id']; ?>').bind('change', function() {
+
+ var value = '0';
+ if (jQuery(this).prop('checked') === true) value = '1';
+
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1',
+ data: {
+ field: 'vari_active',
+ field_id: '<?php echo $vari['id']; ?>',
+ product_id: jQuery('#wpsg_mod_productvariants_product_id').val(),
+ value: value
+ }
+ } );
+
+ } );
+
+ jQuery('#productvariation_anr_<?php echo $vari['id']; ?>').wspg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1', {
+ submitdata: {
+ field: 'vari_anr',
+ product_id: jQuery('#wpsg_mod_productvariants_product_id').val(),
+ field_id: '<?php echo $vari['id']; ?>'
+ }
+ });
+
+ jQuery('#productvariation_price_<?php echo $vari['id']; ?>').wspg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1', {
+ submitdata: {
+ field: 'vari_price',
+ product_id: jQuery('#wpsg_mod_productvariants_product_id').val(),
+ field_id: '<?php echo $vari['id']; ?>'
+ }
+ });
+
+ jQuery('#productvariation_stock_<?php echo $vari['id']; ?>').wspg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1', {
+ submitdata: {
+ field: 'vari_stock',
+ product_id: jQuery('#wpsg_mod_productvariants_product_id').val(),
+ field_id: '<?php echo $vari['id']; ?>'
+ }
+ });
+ <?php } ?>
+
+ /* ]]> */</script>
+ </td>
+ <td class="col1"><span class="wpsg_editable" id="productvariation_name_<?php echo $vari['id']; ?>"><?php echo wpsg_hspc($vari['name']); ?></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_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>
+ <td class="col_stock"><span class="wpsg_editable" id="productvariation_stock_<?php echo $vari['id']; ?>"><?php echo wpsg_hspc($vari['stock']); ?></span></td>
+ <?php } else { ?>
+ <td class="col_action">
+
+ <a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Variation löschen', 'wpsg'); ?>" onclick="return wpsg_mod_productvariation_del(<?php echo $vari['id']; ?>);"><span class="glyphicon glyphicon-trash"></span></a>
+
+ </td>
+ <?php } ?>
+
+ </tr>
+
+ <?php /* ?>
+ <tr>
+ <td class="col_id"> </td>
+ <td class="col_image" colspan="5">
+ TODO: Bilder
+ </td>
+ </tr>
+ */ ?>
+ </tbody>
+ <?php } ?>
+
+ </table>
+
+ <script type="text/javascript">/* <![CDATA[ */
+
+ <?php if (!wpsg_isSizedInt($this->view['product_id']) || wpsg_isSizedInt($this->view['variant']['product_id'])) { ?>
+
+ jQuery('.wpsg_mod_productvariants_table_variation').sortable( {
+ items: 'tbody',
+ helper: wpsg_Tablefix,
+ update: function(event, ui) {
+
+ var wpsg_reorder = jQuery(this).sortable('toArray');
+ var product_id = jQuery('#wpsg_mod_productvariants_product_id').val();
+
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1',
+ data: {
+ 'field': 'vari_pos',
+ 'value': jQuery(this).sortable('toArray'),
+ 'product_id': product_id
+ },
+ success: function(data) { }
+ } );
+
+ }
+ } ).disableSelection();
+
+ <?php } ?>
+
+ <?php if (wpsg_isSizedInt($this->view['variant']['product_id']) || !wpsg_isSizedInt($this->view['product_id'])) { ?>
+ jQuery('#wpsg_mod_productvariants_variation_add_button').show();
+ <?php } else { ?>
+ jQuery('#wpsg_mod_productvariants_variation_add_button').hide();
+ <?php } ?>
+
+ /* ]]> */</script>
+
+ <?php if (!wpsg_isSizedInt($this->view['product_id'])) { ?>
+ <p class="wpsg_hinweis"><?php echo __('Reihenfolge kann mittels Drag&Drop verändert werden.', 'wpsg'); ?></p>
+ <?php } ?>
+
+<?php } else { ?>
+<?php echo __('Bisher keine Variationen der Variante angelegt.', 'wpsg'); ?>
+<?php } ?>
\ No newline at end of file diff --git a/views/mods/mod_productvariants/admin_html.phtml b/views/mods/mod_productvariants/admin_html.phtml new file mode 100644 index 0000000..f2aa433 --- /dev/null +++ b/views/mods/mod_productvariants/admin_html.phtml @@ -0,0 +1,226 @@ +<?php
+
+ /**
+ * HTML Teil für die Produktvariablenverwaltung
+ * (GLOBAL und Produktbezogen)
+ */
+
+?>
+
+<div id="wpsg_mod_productvariants_dialog" class="wpsg_mod_productvariants_dialog_noDialog">
+
+ <div class="modal-body">
+
+ </div>
+ <div class="modal-footer">
+
+ <button type="button" class="btn-sm wpsg_mod_productvariants_variants btn btn-default" onclick="return wpsg_mod_productvariants_add();"><span class="glyphicon glyphicon-plus"></span> <?php echo __('Neue Produktvariante', 'wpsg'); ?></button>
+
+ <button type="button" class="btn-sm wpsg_mod_productvariants_variants_vari btn btn-default" id="wpsg_mod_productvariants_variation_add_button" style="display:none;" onclick="return wpsg_mod_productvariants_variation_add();"><span class="glyphicon glyphicon-plus"></span> <?php echo __('Neue Variation', 'wpsg'); ?></button>
+ <button type="button" class="btn-sm wpsg_mod_productvariants_variants_vari btn btn-default" style="display:none;" onclick="return wpsg_mod_productvariants_back();"><span class="glyphicon glyphicon-chevron-left"></span> <?php echo __('Zurück', 'wpsg'); ?></button>
+ </div>
+
+</div>
+
+<script type="text/javascript">/* <![CDATA[ */
+
+ function wpsg_mod_productvariants_del(variant_id)
+ {
+
+ if (!confirm('<?php echo __('Sind Sie sich sicher, dass Sie die Variante löschen möchten?', 'wpsg'); ?>')) return false;
+
+ var product_id = jQuery('#wpsg_mod_productvariants_product_id').val();
+
+ 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'); ?>" />');
+
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&noheader=1',
+ data: {
+ 'subaction': 'admin_del',
+ 'variant_id': variant_id,
+ 'product_id': product_id
+ },
+ success: function(data) {
+
+ jQuery('#wpsg_mod_productvariants_dialog .modal-body').html(data);
+ jQuery('#wpsg_mod_productvariants_dialog button').prop('disabled', false);
+
+ }
+ } );
+
+ return false;
+
+ } // function wpsg_mod_productvariants_del(variant_id)
+
+ function wpsg_mod_productvariation_del(variation_id)
+ {
+
+ if (!confirm('<?php echo __('Sind Sie sich sicher, dass Sie die Variation löschen möchten?', 'wpsg'); ?>')) return false;
+
+ var vari_id = jQuery('#wpsg_mod_productvariants_var_id').val();
+
+ 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'); ?>" />');
+
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&noheader=1',
+ data: {
+ 'subaction': 'admin_variation_del',
+ 'variation_id': variation_id,
+ 'variant_id': vari_id
+ },
+ success: function(data) {
+
+ jQuery('#wpsg_mod_productvariants_dialog .modal-body').html(data);
+ jQuery('#wpsg_mod_productvariants_dialog button').prop('disabled', false);
+
+ }
+ } );
+
+ return false;
+
+ } // function wpsg_mod_productvariation_del(variation_id)
+
+ function wpsg_mod_productvariants_edit(variant_id)
+ {
+
+ var product_id = jQuery('#wpsg_mod_productvariants_product_id').val();
+
+ 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'); ?>" />');
+
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&noheader=1',
+ data: {
+ 'subaction': 'admin_edit',
+ 'variant_id': variant_id,
+ 'product_id': product_id
+ },
+ success: function(data) {
+
+ jQuery('.wpsg_mod_productvariants_variants').hide();
+ jQuery('.wpsg_mod_productvariants_variants_vari').show();
+
+ jQuery('#wpsg_mod_productvariants_dialog .modal-body').html(data);
+
+ jQuery('#wpsg_mod_productvariants_dialog button').prop('disabled', false);
+
+ }
+ } );
+
+ return false;
+
+ } // function wpsg_mod_productvariants_edit(variant_id)
+
+ function wpsg_mod_productvariants_variation_add()
+ {
+
+ var variant_id = jQuery('#wpsg_mod_productvariants_var_id').val();
+ var product_id = jQuery('#wpsg_mod_productvariants_product_id').val();
+
+ 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'); ?>" />');
+
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&noheader=1',
+ data: {
+ 'subaction': 'admin_variation_add',
+ 'variant_id': variant_id,
+ 'product_id': product_id
+ },
+ success: function(data) {
+
+ jQuery('#wpsg_mod_productvariants_dialog .modal-body').html(data);
+ jQuery('#wpsg_mod_productvariants_dialog button').prop('disabled', false);
+
+ }
+ } );
+
+ return false;
+
+ } // function wpsg_mod_productvariants_variation_add()
+
+ function wpsg_mod_productvariants_add()
+ {
+
+ var product_id = jQuery('#wpsg_mod_productvariants_product_id').val();
+
+ 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'); ?>" />');
+
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&noheader=1',
+ data: {
+ 'subaction': 'admin_add',
+ 'product_id': product_id
+ },
+ success: function(data) {
+
+ jQuery('#wpsg_mod_productvariants_dialog .modal-body').html(data);
+ jQuery('#wpsg_mod_productvariants_dialog button').prop('disabled', false);
+
+ }
+ } );
+
+ return false;
+
+ } // function wpsg_mod_productvariants_add()
+
+ function wpsg_mod_productvariants_back()
+ {
+
+ var product_id = jQuery('#wpsg_mod_productvariants_product_id').val();
+
+ 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'); ?>" />');
+
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&noheader=1',
+ data: {
+ 'subaction': 'admin_show',
+ 'product_id': product_id
+ },
+ success: function(data) {
+
+ jQuery('.wpsg_mod_productvariants_variants').show();
+ jQuery('.wpsg_mod_productvariants_variants_vari').hide();
+ jQuery('#wpsg_mod_productvariants_dialog button').prop('disabled', false);
+
+ jQuery('#wpsg_mod_productvariants_dialog .modal-body').html(data);
+
+ }
+ } );
+
+ return false;
+
+ } // function wpsg_mod_productvariants_back()
+
+ 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'); ?>" />');
+
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&noheader=1',
+ data: {
+ 'subaction': 'admin_show',
+ 'product_id': product_id
+ },
+ success: function(data) {
+
+ jQuery('.wpsg_mod_productvariants_variants').show();
+ jQuery('.wpsg_mod_productvariants_variants_vari').hide();
+
+ jQuery('#wpsg_mod_productvariants_dialog .modal-body').html(data);
+ jQuery('#wpsg_mod_productvariants_dialog button').prop('disabled', false);
+
+ }
+ } );
+
+ return false;
+
+ } // function wpsg_mod_productvariants_show()
+
+/* ]]> */</script>
\ No newline at end of file diff --git a/views/mods/mod_productvariants/admin_show.phtml b/views/mods/mod_productvariants/admin_show.phtml new file mode 100644 index 0000000..099d8a2 --- /dev/null +++ b/views/mods/mod_productvariants/admin_show.phtml @@ -0,0 +1,102 @@ +<?php
+
+ /**
+ * Verwaltung der Produktvarianten im Backend
+ */
+
+?>
+
+<input type="hidden" id="wpsg_mod_productvariants_product_id" value="<?php echo $this->view['product_id']; ?>" />
+
+<?php if (wpsg_isSizedArray($this->view['arVariants'])) { ?>
+
+ <table class="table table-striped wpsg_mod_productvariants_table_variants">
+ <thead>
+ <tr>
+ <th class="col_id"><?php echo __('Id', 'wpsg'); ?></th>
+ <th class="col1"><?php echo __('Name', 'wpsg'); ?></th>
+ <th class="col_vari"><?php echo __('Variationen', 'wpsg'); ?></th>
+
+ <?php if (!wpsg_isSizedInt($this->view['product_id'])) { ?>
+ <th class="col_products"><?php echo __('Produkte', 'wpsg'); ?></th>
+ <?php } ?>
+
+ <th class="col_action"></th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php foreach ($this->view['arVariants'] as $var) { ?>
+ <tr id="var_<?php echo $var['id']; ?>">
+ <td class="col_id"><?php echo $var['id']; ?></td>
+ <td class="col1">
+ <span class="wpsg_editable" id="productvariants_name_<?php echo $var['id']; ?>"><?php echo wpsg_hspc($var['name']); ?></span>
+ <?php if (wpsg_isSizedInt($var['product_id'])) { ?>
+ <span class="wpsg_mod_productvariants_info"><?php echo __('(Produktbezogen)', 'wpsg'); ?></span>
+ <?php } ?>
+ </td>
+ <td class="col_vari"><?php
+
+ if (wpsg_isSizedInt($this->view['product_id'])) echo $var['count_active'].'/'.$var['count_variation'];
+ else echo $var['count_variation'];
+
+ ?></td>
+ <?php if (!wpsg_isSizedInt($this->view['product_id'])) { ?>
+ <td class="col_products"><?php echo wpsg_hspc($var['count_produkte']); ?></td>
+ <?php } ?>
+ <td class="col_action">
+
+ <script type="text/javascript">/* <![CDATA[ */
+
+ <?php if ((wpsg_isSizedInt($this->view['product_id']) && $this->view['product_id'] == $var['product_id']) || (!wpsg_isSizedInt($var['product_id']) && !wpsg_isSizedInt($this->view['product_id']))) { ?>
+ jQuery('#productvariants_name_<?php echo $var['id']; ?>').wspg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1', {
+ submitdata: {
+ field: 'name',
+ field_id: '<?php echo $var['id']; ?>'
+ }
+ });
+ <?php } ?>
+
+ /* ]]> */</script>
+
+ <a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Variante bearbeiten', 'wpsg'); ?>" onclick="return wpsg_mod_productvariants_edit(<?php echo $var['id']; ?>);"><span class="glyphicon glyphicon-pencil"></span></a>
+
+ <?php if ((wpsg_isSizedInt($this->view['product_id']) && $this->view['product_id'] == $var['product_id']) || (!wpsg_isSizedInt($var['product_id']) && !wpsg_isSizedInt($this->view['product_id']))) { ?>
+ <a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Variante löschen', 'wpsg'); ?>" onclick="return wpsg_mod_productvariants_del(<?php echo $var['id']; ?>);"><span class="glyphicon glyphicon-trash"></span></a>
+ <?php } ?>
+
+ </td>
+ </tr>
+ <?php } ?>
+ </tbody>
+ </table>
+
+ <p class="wpsg_hinweis"><?php echo __('Reihenfolge kann mittels Drag&Drop verändert werden.', 'wpsg'); ?></p>
+
+ <script>/* <![CDATA[ */
+
+ jQuery('.wpsg_mod_productvariants_table_variants tbody').sortable( {
+ items: 'tr',
+ helper: wpsg_Tablefix,
+ update: function(event, ui) {
+
+ var wpsg_reorder = jQuery(this).sortable('toArray');
+ var product_id = jQuery('#wpsg_mod_productvariants_product_id').val();
+
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1',
+ data: {
+ 'field': 'pos',
+ 'product_id': product_id,
+ 'value': jQuery(this).sortable('toArray')
+ },
+ success: function(data) { }
+ } );
+
+ }
+ } ).disableSelection();
+
+ /* ]]> */</script>
+
+<?php } else { ?>
+<?php echo __('Bisher keine Produktvarianten angelegt.', 'wpsg'); ?>
+<?php } ?>
\ 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 new file mode 100644 index 0000000..21b3e43 --- /dev/null +++ b/views/mods/mod_productvariants/produkt_addedit_content.phtml @@ -0,0 +1,33 @@ +<?php
+
+ /**
+ * Template für die Verwaltung der Produktvarianten innerhalb des Produktes
+ */
+
+?>
+
+<?php echo wpsg_drawForm_AdminboxStart(__('Produktvarianten', 'wpsg')); ?>
+
+<?php if (wpsg_isSizedInt($this->view['data']['id'])) { ?>
+
+ <?php echo $this->view['wpsg_mod_productvariants']['html']; ?>
+
+ <script type="text/javascript">/* <![CDATA[ */
+
+ jQuery(document).ready(function() {
+
+ wpsg_mod_productvariants_show(<?php echo $this->view['data']['id']; ?>);
+
+ } );
+
+ /* ]]> */</script>
+
+<?php } else { ?>
+
+ <?php echo __('Bitte speichern Sie das Produkt zuerst.', 'wpsg'); ?>
+
+<?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 diff --git a/views/mods/mod_productvariants/settings_edit.phtml b/views/mods/mod_productvariants/settings_edit.phtml new file mode 100644 index 0000000..019f4f5 --- /dev/null +++ b/views/mods/mod_productvariants/settings_edit.phtml @@ -0,0 +1,22 @@ +<?php
+
+ /*
+ * Template für die Einstellungen des Moduls
+ */
+
+?>
+
+<h4><?php echo __('Verwaltung der globalen Produktvarianten', 'wpsg'); ?></h4>
+
+<?php echo $this->view['wpsg_mod_productvariants']['html']; ?>
+
+<script type="text/javascript">/* <![CDATA[ */
+
+ jQuery(document).ready(function() {
+
+ wpsg_mod_productvariants_show(0);
+
+ } );
+
+/* ]]> */</script>
+
\ No newline at end of file |
