/*
Theme Name: Flatsome Child
Description: This is a child theme for Flatsome Theme
Author: UX Themes
Template: flatsome
Version: 3.0
*/

/*************** ADD CUSTOM CSS HERE.   ***************/


@media only screen and (max-width: 48em) {
/*************** ADD MOBILE ONLY CSS HERE  ***************/


}


// Thêm thứ tự sản phẩm trong WooCommerce
jQuery(function($){
	//alert('sdfsd;');
	$(".saveorderingdddd").click(function(){
		var post=document.getElementsByName('post[]');
		var post_ids ='';

		for(key=0; key < post.length; key++)  {
			if(key == 0){
				post_ids =post[key].value;
			}else{
				post_ids = post_ids+","+post[key].value;
			}
		
			//your code goes here
		}
		var order=document.getElementsByName('ordering[]');
		var orderings ='';

		for(key=0; key < order.length; key++)  {
			if(key == 0){
				orderings =order[key].value;
			}else{
				orderings = orderings +","+order[key].value;
			}
		
			//your code goes here
		}
		$.ajax({
            type: 'POST',
            url: ordering_ob.ajaxurl,
            data:{action: 'ordering',post_ids:post_ids,orderings:orderings},
            success: function(data){
				console.log(data);
                if(data == "data"){
					 location.reload();
				}
            }
        });
		
		return false;
	});
});