summaryrefslogtreecommitdiff
path: root/views/mods
diff options
context:
space:
mode:
Diffstat (limited to 'views/mods')
-rw-r--r--views/mods/mod_productvariants/frontend.js86
-rw-r--r--views/mods/mod_produktbilder/settings_edit.phtml6
2 files changed, 7 insertions, 85 deletions
diff --git a/views/mods/mod_productvariants/frontend.js b/views/mods/mod_productvariants/frontend.js
index 9e50d0b..94cae44 100644
--- a/views/mods/mod_productvariants/frontend.js
+++ b/views/mods/mod_productvariants/frontend.js
@@ -1,95 +1,23 @@
-
- var wpsg_vp_vari = new Array();
-
- function wpsg_vp_switch(product_id, product_index, elem)
- {
- /*
- 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;
-
- v1 = jQuery(elem).attr("data-wpsg-id");
- //v2 = jQuery(elem).parent().find('input').val();
- jQuery(elem).parent().find('input').val(v1);
- //alert('v1=' + v1 + ' v2=' + v2);
-
- jQuery('#wpsg_produktform_' + product_index).append('<div class="wpsg_product_layer"><img src="' + wpsg_ajax.img_ajaxloading + '" alt="' + wpsg_ajax.label_pleasewait + '" /></div>');
- 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)
{
- var product_index = jQuery(event.target).parents('.wpsg_mod_productvariants_product_wrap').attr('wpsg-productindex');
+ var template_index = jQuery(event.target).closest('.wpsg_mod_productvariants_product_wrap').attr('wpsg-productindex');
- //jQuery('#wpsg_produktform_' + product_index).append('<div class="wpsg_product_layer"><img src="' + wpsg_ajax.img_ajaxloading + '" alt="' + wpsg_ajax.label_pleasewait + '" /></div>');
-
+ wpsg_blockProductTemplate(template_index);
+
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(),
- 'form_data': jQuery('#wpsg_produktform_' + product_index).serialize(),
- 'product_index': product_index
+ 'wpsg_post_id': jQuery('#wpsg_produktform_' + template_index + ' input[name="wpsg_post_id"]').val(),
+ 'form_data': jQuery('#wpsg_produktform_' + template_index).serialize(),
+ 'product_index': template_index
},
'success': function(data) {
- jQuery('#wpsg_produktform_' + product_index).replaceWith(data);
+ jQuery('#wpsg_produktform_' + template_index).replaceWith(data);
}
} );
diff --git a/views/mods/mod_produktbilder/settings_edit.phtml b/views/mods/mod_produktbilder/settings_edit.phtml
index 1c035ef..b34edc6 100644
--- a/views/mods/mod_produktbilder/settings_edit.phtml
+++ b/views/mods/mod_produktbilder/settings_edit.phtml
@@ -5,9 +5,3 @@
*/
?>
-<?php echo wpsg_drawForm_Input('wpsg_mod_produktbilder_width', __('Bildbreite (Vorschau)', 'wpsg'), $this->get_option('wpsg_mod_produktbilder_width'), array('help' => 'wpsg_mod_produktbilder_width')); ?>
-<?php echo wpsg_drawForm_Input('wpsg_mod_produktbilder_height', __('Bildhöhe (Vorschau)', 'wpsg'), $this->get_option('wpsg_mod_produktbilder_height'), array('help' => 'wpsg_mod_produktbilder_height')); ?>
-<?php echo wpsg_drawForm_Select('wpsg_mod_produktbilder_mode', __('Bildmodus (Vorschau)', 'wpsg'), $this->callMod('wpsg_mod_produktbilder', 'getImageModes'), $this->get_option('wpsg_mod_produktbilder_mode'), array('help' => 'wpsg_mod_produktbilder')); ?>
-<?php echo wpsg_drawForm_Input('wpsg_mod_produktbilder_quality', __('Bildqualität (PNG/JPG)', 'wpsg'), $this->get_option('wpsg_mod_produktbilder_quality'), array('help' => 'wpsg_mod_produktbilder_quality','hint' => __('0 = Schlechte Qualität, 100 = Gute Qualität', 'wpsg'))); ?>
-
-<a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_produktbilder&wpsg_mod_produktbilder_clearcache=1&noheader=1"><span class="wpsg-glyphicon glyphicon glyphicon-trash"></span><?php echo __('Bildercache löschen', 'wpsg'); ?></a> \ No newline at end of file