/**
  * wcj_update_products_price_by_country_for_single_product.
  *
  * @version 2.5.6
  * @since   2.5.3
  */
 function wcj_update_products_price_by_country_for_single_product($product_id)
 {
     $_product = wc_get_product($product_id);
     if ($_product->is_type('variable')) {
         $available_variations = $_product->get_available_variations();
         for ($i = 1; $i <= apply_filters('booster_get_option', 1, get_option('wcj_price_by_country_total_groups_number', 1)); $i++) {
             $min_variation_price = PHP_INT_MAX;
             $max_variation_price = 0;
             foreach ($available_variations as $variation) {
                 $variation_product_id = $variation['variation_id'];
                 $_old_variation_price = get_post_meta($variation_product_id, '_price', true);
                 if (wcj_is_module_enabled('multicurrency_base_price')) {
                     $_old_variation_price = wcj_price_by_product_base_currency($_old_variation_price, $product_id);
                 }
                 $price_by_country = wcj_price_by_country($_old_variation_price, $variation_product_id, $i, 'woocommerce_get_price');
                 update_post_meta($variation_product_id, '_' . 'wcj_price_by_country_' . $i, $price_by_country);
                 if ('' != $price_by_country && $price_by_country < $min_variation_price) {
                     $min_variation_price = $price_by_country;
                 }
                 if ($price_by_country > $max_variation_price) {
                     $max_variation_price = $price_by_country;
                 }
             }
             delete_post_meta($product_id, '_' . 'wcj_price_by_country_' . $i);
             add_post_meta($product_id, '_' . 'wcj_price_by_country_' . $i, $min_variation_price);
             if ($min_variation_price != $max_variation_price) {
                 add_post_meta($product_id, '_' . 'wcj_price_by_country_' . $i, $max_variation_price);
             }
         }
     } else {
         $_old_price = get_post_meta($product_id, '_price', true);
         if (wcj_is_module_enabled('multicurrency_base_price')) {
             $_old_price = wcj_price_by_product_base_currency($_old_price, $product_id);
         }
         for ($i = 1; $i <= apply_filters('booster_get_option', 1, get_option('wcj_price_by_country_total_groups_number', 1)); $i++) {
             $price_by_country = wcj_price_by_country($_old_price, $product_id, $i, 'woocommerce_get_price');
             update_post_meta($product_id, '_' . 'wcj_price_by_country_' . $i, $price_by_country);
         }
     }
 }
 /**
  * change_price_by_country.
  *
  * @version 2.5.3
  */
 function change_price_by_country($price, $product)
 {
     if (null != ($group_id = $this->get_customer_country_group_id())) {
         return wcj_price_by_country($price, $product, $group_id);
     }
     // No changes
     return $price;
 }