summaryrefslogtreecommitdiff
path: root/views/mods/mod_productvariants/frontend.js
blob: bb919d2783944f95164d72fc44af123d3304b056 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 
    function wpsg_mod_productvariants_reload(event)
    {
        
        var template_index = jQuery(event.target).closest('.wpsg_mod_productvariants_product_wrap').attr('wpsg-productindex');
 
        wpsg_blockProductTemplate(template_index);
  
		jQuery.ajax( {
			'url': wpsg_ajax.ajaxurl,
			'method': 'get',
			'data': {
				'action': 'wpsg_productvariants_switch',
				'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_' + template_index).replaceWith(data);
				
			}
		} );
        
    } // function wpsg_mod_productvariants_reload(event)