<?php
   $id = $_POST['id'];
 
 
		$type_import = !empty($_POST['type_import'])? $_POST['type_import']:'';
 		if($type_import=='page_homepage_1' || $homepage_import=='page_homepage_1'){
			$homepage_1 = get_page_by_path( 'homepage-1' );								
			if(!empty($homepage_1->ID)){
				update_option( 'show_on_front', 'page' );
				update_option( 'page_on_front',$homepage_1->ID );	
			}
		}
 		if($type_import=='page_homepage_2'|| $homepage_import=='page_homepage_2'){
			$homepage_2 = get_page_by_path( 'homepage-2' );								
			if(!empty($homepage_2->ID)){
				update_option( 'show_on_front', 'page' );
				update_option( 'page_on_front',$homepage_2->ID );	
			}
		}
 		if($type_import=='page_homepage_3'|| $homepage_import=='page_homepage_3'){
			$homepage_3 = get_page_by_path( 'homepage-3' );								
			if(!empty($homepage_3->ID)){
				update_option( 'show_on_front', 'page' );
				update_option( 'page_on_front',$homepage_3->ID );	
			}
		}
 	 
		if($type_import=='page_homepage_3'|| $homepage_import=='page_homepage_3'){
			$homepage_3 = get_page_by_path( 'homepage-3' );								
			if(!empty($homepage_3->ID)){
				update_option( 'show_on_front', 'page' );
				update_option( 'page_on_front',$homepage_3->ID );	
			}
		}
		if($type_import=='page_homepage_4'|| $homepage_import=='page_homepage_4'){
			$homepage_3 = get_page_by_path( 'homepage-4' );								
			if(!empty($homepage_3->ID)){
				update_option( 'show_on_front', 'page' );
				update_option( 'page_on_front',$homepage_3->ID );	
			}
		}
		
	 
		if($type_import=='page_homepage_5'|| $homepage_import=='page_homepage_5'){
			$homepage_5 = get_page_by_path( 'homepage-5' );								
			if(!empty($homepage_5->ID)){
				update_option( 'show_on_front', 'page' );
				update_option( 'page_on_front',$homepage_5->ID );	
			}
		} 	
		
			if($type_import=='page_homepage_6'|| $homepage_import=='page_homepage_6'){
			$homepage_6 = get_page_by_path( 'homepage-6' );								
			if(!empty($homepage_6->ID)){
				update_option( 'show_on_front', 'page' );
				update_option( 'page_on_front',$homepage_6->ID );	
			}
		} 	  
	if($type_import=='page_homepage_7'|| $homepage_import=='page_homepage_7'){
			$homepage_7 = get_page_by_path( 'homepage-7' );								
			if(!empty($homepage_7->ID)){
				update_option( 'show_on_front', 'page' );
				update_option( 'page_on_front',$homepage_7->ID );	
			}
		} 	  
  		if($type_import=='page_homepage_8'|| $homepage_import=='page_homepage_8'){
			$homepage_8 = get_page_by_path( 'homepage-8' );								
			if(!empty($homepage_8->ID)){
				update_option( 'show_on_front', 'page' );
				update_option( 'page_on_front',$homepage_8->ID );	
			}
		} 	  
		
		if($type_import=='page_homepage_9'|| $homepage_import=='page_homepage_9'){
			$homepage_9 = get_page_by_path( 'homepage-9' );								
			if(!empty($homepage_9->ID)){
				update_option( 'show_on_front', 'page' );
				update_option( 'page_on_front',$homepage_9->ID );	
			}
		} 	  
		if($type_import=='page_homepage_10'|| $homepage_import=='page_homepage_10'){
			$homepage_10 = get_page_by_path( 'homepage-10' );								
			if(!empty($homepage_10->ID)){
				update_option( 'show_on_front', 'page' );
				update_option( 'page_on_front',$homepage_10->ID );	
			}
		} 	
		
		
		if($type_import=='page_homepage_11'|| $homepage_import=='page_homepage_11'){
			$homepage_11 = get_page_by_path( 'homepage-11' );								
			if(!empty($homepage_11->ID)){
				update_option( 'show_on_front', 'page' );
				update_option( 'page_on_front',$homepage_11->ID );	
			}
		} 	   
		
		
		if($type_import=='page_homepage_12'|| $homepage_import=='page_homepage_12'){
			$homepage_12 = get_page_by_path( 'homepage-12' );								
			if(!empty($homepage_12->ID)){
				update_option( 'show_on_front', 'page' );
				update_option( 'page_on_front',$homepage_12->ID );	
			}
		} 	   
		
	if($homepage_import=='product_page'){
		$page_shop = get_page_by_path( 'shop' );								
		if(!empty($page_shop->ID) ){
  		update_option( 'woocommerce_shop_page_id',$page_shop->ID );	
 		}
		
		$page_cart = get_page_by_path( 'cart' );								
		if(!empty($page_cart->ID)){
 		update_option( 'woocommerce_cart_page_id',$page_cart->ID );	
 		}	
		
		$page_checkout = get_page_by_path( 'checkout' );								
		if(!empty($page_checkout->ID)){
 		update_option( 'woocommerce_checkout_page_id',$page_checkout->ID );	
 		}	
		
		$page_myaccount = get_page_by_path( 'my-account' );								
		if(!empty($page_myaccount->ID)){
 		update_option( 'woocommerce_myaccount_page_id',$page_myaccount->ID );	
 		}
			$page_wishlist = get_page_by_path( 'wishlist' );								
		if(!empty($page_wishlist->ID)){
 		update_option( 'yith_wcwl_wishlist_page_id',$page_wishlist->ID );	
 		}

		} 