From ce00007e22a06e6768036c4e9fe4aed84dfba3d4 Mon Sep 17 00:00:00 2001 From: hartmut Date: Wed, 17 May 2017 11:11:46 +0000 Subject: Bestellbedingungen und Korrektur Varianten git-svn-id: https://[internal]/wordpress/plugins/wpsg4@6268 0d5edaf7-2b12-4e95-93f4-047927463d4b --- views/mods/mod_productvariants/admin_edit.phtml | 2 +- views/mods/mod_productvariants/frontend.js | 13 +++++++++---- views/mods/mod_productvariants/produkt.phtml | 6 +++--- 3 files changed, 13 insertions(+), 8 deletions(-) (limited to 'views/mods/mod_productvariants') diff --git a/views/mods/mod_productvariants/admin_edit.phtml b/views/mods/mod_productvariants/admin_edit.phtml index 0a0dda4..f55bc9f 100644 --- a/views/mods/mod_productvariants/admin_edit.phtml +++ b/views/mods/mod_productvariants/admin_edit.phtml @@ -181,7 +181,7 @@ view['variant']['id'] $vari $var $kv $_REQUEST['pic'] - $file2 = $b['basename']; + $file2 = $b['basenameori']; $href = wp_get_attachment_image_src($b['post_id'], Array(25, 25)); ?> pic" id="" diff --git a/views/mods/mod_productvariants/frontend.js b/views/mods/mod_productvariants/frontend.js index 836bbdc..9e50d0b 100644 --- a/views/mods/mod_productvariants/frontend.js +++ b/views/mods/mod_productvariants/frontend.js @@ -1,9 +1,9 @@ var wpsg_vp_vari = new Array(); - function wpsg_vp_switch(product_id, product_index) + function wpsg_vp_switch(product_id, product_index, elem) { - + /* var var_key = 'pv_' + product_id + "|"; //alert('Länge: ' + wpsg_vp_vari[product_id].length); @@ -37,11 +37,16 @@ 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('
' + wpsg_ajax.label_pleasewait + '
'); jQuery.ajax( { @@ -54,7 +59,7 @@ '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_key': var_key, 'product_index': product_index }, 'success': function(data) { diff --git a/views/mods/mod_productvariants/produkt.phtml b/views/mods/mod_productvariants/produkt.phtml index e449e9c..9984745 100644 --- a/views/mods/mod_productvariants/produkt.phtml +++ b/views/mods/mod_productvariants/produkt.phtml @@ -109,7 +109,7 @@ $pbw = $this->get_option('wpsg_vp_imageselect_width'); $pbh = $this->get_option('wpsg_vp_imageselect_height'); ?> -
+ @@ -127,11 +127,11 @@ hasMod('wpsg_mod_stock') || $vari['stock'] > 0) { ?> view['wpsg_mod_productvariants']['set'][$kk]) == $kv)?'checked="checked"':''); ?> id="wpsg_vpfield_getProduktId($this->view['data']['id']); ?>__" - onclick="wpsg_vp_switch(getProduktId($this->view['data']['id']); ?>, view['product_index']; ?>);" + onclick="wpsg_vp_switch(getProduktId($this->view['data']['id']); ?>, view['product_index']; ?>, this);" type="radio" name="wpsg_vp[]" value="" />  - view['wpsg_mod_productvariants']['set'][$k] == $kv)?'checked="checked"':''); ?> id="wpsg_vpfield_getProduktId($this->view['data']['id']); ?>__" onclick="wpsg_vp_switch(getProduktId($this->view['data']['id']); ?>, view['product_index']; ?>);" type="radio" name="wpsg_vp[]" value="" />  + view['wpsg_mod_productvariants']['set'][$k] == $kv)?'checked="checked"':''); ?> id="wpsg_vpfield_getProduktId($this->view['data']['id']); ?>__" onclick="wpsg_vp_switch(getProduktId($this->view['data']['id']); ?>, view['product_index']; ?>, this);" type="radio" name="wpsg_vp[]" value="" />  -- cgit v1.2.3