summaryrefslogtreecommitdiff
path: root/views/mods/mod_productvariants/frontend.js
blob: a6d62fa0ce775fa52f41ce03ffd361a9ea9fae92 (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 product_index = jQuery(event.target).parents('.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>');
 
		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
			},
			'success': function(data) {
		 
				jQuery('#wpsg_produktform_' + product_index).replaceWith(data);
				
			}
		} );
        
    } // function wpsg_mod_productvariants_reload(event)