Subversion Repositories wpShopGermany4

Rev

Rev 6165 | Rev 6314 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6165 Rev 6268
Line 1... Line 1...
1
 
1
 
2
	var wpsg_vp_vari = new Array();	
2
	var wpsg_vp_vari = new Array();	
3
		  
3
		  
4
	function wpsg_vp_switch(product_id, product_index)
4
	function wpsg_vp_switch(product_id, product_index, elem)
5
	{
5
	{
6
			 
6
			 /*
7
		var var_key = 'pv_' + product_id + "|";
7
		var var_key = 'pv_' + product_id + "|";
8
		//alert('Länge: ' + wpsg_vp_vari[product_id].length);
8
		//alert('Länge: ' + wpsg_vp_vari[product_id].length);
9
		
9
		
10
		for (var i = 0; i < wpsg_vp_vari[product_id].length; i ++)
10
		for (var i = 0; i < wpsg_vp_vari[product_id].length; i ++)
11
		{
11
		{
Line 35... Line 35...
35
					jQuery('#wpsg_vp_' + i).val(vkey2);
35
					jQuery('#wpsg_vp_' + i).val(vkey2);
36
				var_key += vkey1 + vkey2; 
36
				var_key += vkey1 + vkey2; 
37
				if (i < (wpsg_vp_vari[product_id].length - 1)) var_key += "|";
37
				if (i < (wpsg_vp_vari[product_id].length - 1)) var_key += "|";
38
			}
38
			}
39
		}
39
		}
40
		 
40
		 */
41
		//console.log(jQuery('#wpsg_produktform_' + product_index).serialize());
41
		//console.log(jQuery('#wpsg_produktform_' + product_index).serialize());
42
		//console.log(var_key);
42
		//console.log(var_key);
43
		//return;
43
		//return;
44
		
44
		
-
 
45
		v1 = jQuery(elem).attr("data-wpsg-id");
-
 
46
		//v2 = jQuery(elem).parent().find('input').val();
-
 
47
		jQuery(elem).parent().find('input').val(v1);
-
 
48
		//alert('v1=' + v1 + ' v2=' + v2);
-
 
49
		
45
		jQuery('#wpsg_produktform_' + product_index).append('<div class="wpsg_product_layer"><img src="' + wpsg_ajax.img_ajaxloading + '" alt="' + wpsg_ajax.label_pleasewait + '" /></div>');
50
		jQuery('#wpsg_produktform_' + product_index).append('<div class="wpsg_product_layer"><img src="' + wpsg_ajax.img_ajaxloading + '" alt="' + wpsg_ajax.label_pleasewait + '" /></div>');
46
 
51
 
47
		jQuery.ajax( {
52
		jQuery.ajax( {
48
			'url': wpsg_ajax.ajaxurl,
53
			'url': wpsg_ajax.ajaxurl,
49
			'method': 'get',
54
			'method': 'get',
Line 52... Line 57...
52
				'wpsg_post_id': jQuery('#wpsg_produktform_' + product_index + ' input[name="wpsg_post_id"]').val(),
57
				'wpsg_post_id': jQuery('#wpsg_produktform_' + product_index + ' input[name="wpsg_post_id"]').val(),
53
				'quantity': jQuery('#wpsg_menge_' + product_index).val(),
58
				'quantity': jQuery('#wpsg_menge_' + product_index).val(),
54
				'template': jQuery('#wpsg_produktform_' + product_index + ' input[name="wpsg[template]"]').val(),
59
				'template': jQuery('#wpsg_produktform_' + product_index + ' input[name="wpsg[template]"]').val(),
55
				'referer': jQuery('#wpsg_produktform_' + product_index + ' input[name="myReferer"]').val(),
60
				'referer': jQuery('#wpsg_produktform_' + product_index + ' input[name="myReferer"]').val(),
56
				'form_data': jQuery('#wpsg_produktform_' + product_index).serialize(),
61
				'form_data': jQuery('#wpsg_produktform_' + product_index).serialize(),
57
				'product_key': var_key,
62
			//	'product_key': var_key,
58
				'product_index': product_index
63
				'product_index': product_index
59
			},
64
			},
60
			'success': function(data) {
65
			'success': function(data) {
61
		 
66
		 
62
				jQuery('#wpsg_produktform_' + product_index).replaceWith(data);
67
				jQuery('#wpsg_produktform_' + product_index).replaceWith(data);