' . esc_html__( 'By selecting a replacement, a new variation will be created by modifying the respective overridden variation. Overridden variations with no replacement selected will be deleted', 'woo-alidropship' ) . '
' : '';
wp_send_json( array(
'status' => 'checked',
'message' => '',
'found_items' => $found_items,
'replace_order_html' => $message . '
'vi_wad_draft_product',
'post_status' => array( 'draft', 'override' ),
'order' => 'DESC',
'orderby' => 'date',
'fields' => 'ids',
'posts_per_page' => $per_page,
'paged' => $paged,
);
$vi_wad_search_id = isset( $_GET['vi_wad_search_id'] ) ? sanitize_text_field( $_GET['vi_wad_search_id'] ) : '';// phpcs:ignore WordPress.Security.NonceVerification.Recommended
$keyword = isset( $_GET['vi_wad_search'] ) ? sanitize_text_field( $_GET['vi_wad_search'] ) : '';// phpcs:ignore WordPress.Security.NonceVerification.Recommended
if ( $vi_wad_search_id ) {
$args['post__in'] = array( $vi_wad_search_id );
$args['posts_per_page'] = 1;
$keyword = '';
} else if ( $keyword ) {
$args['s'] = $keyword;
}
// $the_query = new WP_Query( $args );
$the_query = VI_WOO_ALIDROPSHIP_DATA::is_ald_table() ? new Ali_Product_Query( $args ) : new WP_Query( $args );
$count = $the_query->found_posts;
$total_page = $the_query->max_num_pages;
$page_content = '';
if ( $the_query->have_posts() ) {
/*After a product is imported, its html content(Import list) will be removed*/
/*The first wp_editor call includes css file for all editors so call it here and hide it so that editor css is not removed after the first product is imported*/
?>
'html',
'media_buttons' => false,
'tinymce' => true,
'quicktags' => true,
) );
?>
get_params( 'product_gallery' );
$manage_stock = self::$settings->get_params( 'manage_stock' );
$product_categories = self::$settings->get_params( 'product_categories' );
$product_tags = self::$settings->get_params( 'product_tags' );
$product_shipping_class = self::$settings->get_params( 'product_shipping_class' );
$catalog_visibility = self::$settings->get_params( 'catalog_visibility' );
$product_status = self::$settings->get_params( 'product_status' );
$use_different_currency = false;
if ( strtolower( $woocommerce_currency ) != strtolower( $currency ) ) {
$use_different_currency = true;
}
ob_start();
?>
'product_cat',
'orderby' => 'name',
'order' => 'ASC',
'hide_empty' => false
)
);
if ( is_array( $categories ) && count( $categories ) ) {
ob_start();
foreach ( $categories as $category ) {
?>
'product_tag',
'orderby' => 'name',
'order' => 'ASC',
'hide_empty' => false
)
);
if ( is_array( $tags ) && count( $tags ) ) {
ob_start();
foreach ( $tags as $tag ) {
?>
'product_shipping_class',
'orderby' => 'name',
'order' => 'ASC',
'hide_empty' => false
)
);
if ( is_array( $shipping_classes ) && count( $shipping_classes ) ) {
ob_start();
foreach ( $shipping_classes as $shipping_class ) {
?>
countries->get_countries();
foreach ( $the_query->posts as $product_id ) {
$product = Ali_Product_Table::get_post( $product_id );
$title = $product->post_title;
$description = $product->post_content;
$sku = Ali_Product_Table::get_post_meta( $product_id, '_vi_wad_sku', true );
// $attributes = get_post_meta( $product_id, '_vi_wad_attributes', true );
$attributes = self::get_product_attributes( $product_id );
$store_info = Ali_Product_Table::get_post_meta( $product_id, '_vi_wad_store_info', true );
$parent = array();
if ( is_array( $attributes ) && count( $attributes ) ) {
foreach ( $attributes as $attribute_k => $attribute_v ) {
$parent[ $attribute_k ] = $attribute_v['slug'];
}
}
$gallery = Ali_Product_Table::get_post_meta( $product_id, '_vi_wad_gallery', true );
if ( ! $gallery ) {
$gallery = array();
}
$desc_images = Ali_Product_Table::get_post_meta( $product_id, '_vi_wad_description_images', true );
if ( ! $desc_images ) {
$desc_images = array();
} else {
$desc_images = array_values( array_unique( $desc_images ) );
}
$image = isset( $gallery[0] ) ? $gallery[0] : '';
$variations = self::get_product_variations( $product_id );
$price_array = array_filter( array_merge( array_column( $variations, 'sale_price' ), array_column( $variations, 'regular_price' ) ) );
$price_alert = false;
if ( count( $price_array ) ) {
$min_price = min( $price_array );
if ( $min_price ) {
$min_price = VI_WOO_ALIDROPSHIP_DATA::string_to_float( $min_price );
if ( $min_price === 0.01 ) {
$price_alert = true;
}
}
}
$is_variable = ( is_array( $parent ) && count( $parent ) ) ? 1 : 0;
$product_type = $product->post_status;
$override_product_id = $product->post_parent;
$override_product = '';
if ( $product_type === 'override' && $override_product_id ) {
$override_product = Ali_Product_Table::get_post( $override_product_id );
if ( ! $override_product ) {
$product_type = 'draft';
$override_product_id = '';
Ali_Product_Table::wp_update_post( array(
'ID' => $product_id,
'post_parent' => 0,
'post_status' => $product_type,
) );
}
}
$accordion_class = array(
'vi-ui',
'styled',
'fluid',
'accordion',
'active',
self::set( 'accordion' ),
);
if ( $price_alert ) {
$accordion_class[] = self::set( 'product-price-alert' );
}
$shipping_info = Ali_Product_Table::get_post_meta( $product_id, '_vi_wad_shipping_info', true );
$ship_to = $shipping_info['country'] ?? '';
$ship_to = $ship_to == 'UK' ? 'GB' : $ship_to;
$ship_to = $countries[ $ship_to ] ?? $ship_to;
ob_start();
?>
' . $store_name . '';
}
?>
post_date ) ?>
%s %s
',
esc_html__( 'Price of the product applicable to the', 'woo-alidropship' ), esc_html( $ship_to ) );
}
if ( $override_product ) {
?>
post_title ) ?>