如何实现 zencart 批量数据采集 批量商品导入 zencart中实现以下功能:(欢迎广大网友交流 qq:158393237 旺旺: q459255119) 1 找供应商采购谈判 给你进货价
2 一键采集供应商给你的所有商品(批量采集产品价格、批量采集多图、批量发布、批量去水印、批量打上你的店标和logo)
3 “叮”的一声 ,1万条来自不同地区供应商的产品全部发布到你的网站了,而且都是真真实实的成本价、销售价业务数据,及时报告库存不足,那么剩下的是不是就剩下网络营销了呢?
快客特意做了这个接口并增加了自动识别商品属性,自动添加商品分类品牌,以及多图的功能,自发布以来,受到不少网商朋友的好评! ZenCart1.3.9采集程序简介
功能简介
我们保证安全、精准、高效,并有大量客户使用测试,价格不打折,服务不打折!!!
|
入库代码:
//添加产品
function add_product( &$products_id, $current_category_id, $products_name = "", $products_description = "", $products_price = "0", $products_image = "", $products_model = "", $products_price_gross = "0", $products_weight = "", $products_quantity = "0", $manufacturers_id = "", $metatags_title = "", $metatags_keywords = "", $metatags_description = "", $products_url = "", $products_discount_type = "0", $products_discount_type_from = "0", $products_price_sorter = "0", $products_status = "1", $products_date_available = "", $manufacturers_id = "", $product_is_free = "0", $product_is_call = "0", $products_priced_by_attribute = "0", $products_tax_class_id = "0", $products_virtual = "0", $product_is_always_free_shipping = "0", $products_qty_box_status = "1", $products_quantity_order_min = "1", $products_quantity_order_max = "0", $products_quantity_order_units = "1", $products_quantity_mixed = "1", $img_dir = "", $image_delete = "0", $products_image_manual = "", $products_sort_order = "0" )
{
global $db;
$products_name = string2multi_languages_array( $products_name );
$products_description = string2multi_languages_array( $products_description );
$products_url = string2multi_languages_array( $products_url );
//echo $products_image;
//echo products_quantity;
if ( $products_image )
{
//echo $img_dir;
$path = pathinfo( $products_image );
//echo $path;
$path['basename'] = strip_spec_basename( $path['basename'] );
//ECHO $path['basename']; 文件名
$destination = DIR_FS_CATALOG_IMAGES.$img_dir.$path['basename'];
//echo $img_dir."h";
//echo $destination;E:/srv/web/zen1/images/8ac33885-f224-4c6b-aebc-b5407ad201f5.jpg
$dir = DIR_FS_CATALOG_IMAGES.$img_dir;
//echo $products_image;
//echo $img_dir;E:/srv/web/zen/images/
//echo $destination;E:/srv/web/zen/images/T1cQpMXaJyXXXXXXXX-80-80.jpg
$info = getremoteimage( $products_image, $destination );
//echo $info; //info 为空
$products_image = $info ? $img_dir.$path['basename'] : "";
//$products_image=fom_img_path($products_image);
// echo $products_image;空
}
if ( !$products_image )
{
exit( "图片上传失败" );
}
$products_date_available = db_prepare_input( $products_date_available );
$products_date_available = date( "Y-m-d" ) < $products_date_available ? $products_date_available : "null";
$tmp_value = db_prepare_input( $products_quantity );
//$products_quantity = !zen_not_null( $tmp_value ) && $tmp_value == "" || $tmp_value == 0 ? 0 : $tmp_value;
$products_quantity = 1000;
$tmp_value = db_prepare_input( $products_price );
$products_price = !zen_not_null( $tmp_value ) && $tmp_value == "" || $tmp_value == 0 ? 0 : $tmp_value;
$tmp_value = db_prepare_input( $products_weight );
$products_weight = $tmp_value == "" || $tmp_value == 0 ? 0 : $tmp_value;
$sql_data_array = array(
"products_quantity" =>db_prepare_input( ( integer ) $products_quantity ),
"products_type" => db_prepare_input( $_GET['product_type'] ),
"products_model" => db_prepare_input( $products_model ),
"products_price" => $products_price,
"products_date_available" => $products_date_available,
"products_weight" => $products_weight,
"products_status" => db_prepare_input( ( integer )$products_status ),
"products_virtual" => db_prepare_input( ( integer )$products_virtual ),
"products_tax_class_id" => db_prepare_input( ( integer )$products_tax_class_id ),
"manufacturers_id" => $manufacturers_id,
"products_quantity_order_min" => db_prepare_input( $products_quantity_order_min ),
"products_quantity_order_units" => db_prepare_input( $products_quantity_order_units ),
"products_priced_by_attribute" => db_prepare_input( $products_priced_by_attribute ),
"product_is_free" => db_prepare_input( ( integer )$product_is_free ),
"product_is_call" => db_prepare_input( ( integer )$product_is_call ),
"products_quantity_mixed" => db_prepare_input( $products_quantity_mixed ),
"product_is_always_free_shipping" => db_prepare_input( ( integer )$product_is_always_free_shipping ),
"products_qty_box_status" => db_prepare_input( $products_qty_box_status ),
"products_quantity_order_max" => db_prepare_input( $products_quantity_order_max ),
"products_sort_order" => ( integer )db_prepare_input( $products_sort_order ),
"products_discount_type" => db_prepare_input( $products_discount_type ),
"products_discount_type_from" => db_prepare_input( $products_discount_type_from ),
"products_price_sorter" => db_prepare_input( $products_price_sorter )
);
$sql_data_array['products_image'] = $products_image;
$new_image = "true";
if ( $image_delete == 1 )
{
$sql_data_array['products_image'] = "";
$new_image = "false";
}
$insert_sql_data = array(
"products_date_added" => "now()",
"master_categories_id" => ( integer )$current_category_id
);
$sql_data_array = array_merge( $sql_data_array, $insert_sql_data );
zen_db_perform( TABLE_PRODUCTS, $sql_data_array );
$products_id = zen_db_insert_id( );
zen_update_products_price_sorter( $products_id );
$db->execute( "insert into ".TABLE_PRODUCTS_TO_CATEGORIES."\r\n (products_id, categories_id)\r\n values ('".( integer )$products_id."', '".( integer )$current_category_id."')" );
$languages = zen_get_languages( );
$i = 0;
$n = sizeof( $languages );
for ( ; $i < $n; ++$i )
{
$language_id = $languages[$i]['id'];
$sql_data_array = array(
"products_name" => db_prepare_input( $products_name[$language_id] ),
"products_description" => db_prepare_input( $products_description[$language_id] ),
"products_url" => db_prepare_input( $products_url[$language_id] )
);
$insert_sql_data = array(
"products_id" => $products_id,
"language_id" => $language_id
);
$sql_data_array = array_merge( $sql_data_array, $insert_sql_data );
zen_db_perform( TABLE_PRODUCTS_DESCRIPTION, $sql_data_array );
}
}