$data = array(
'product_name' => 'mjpd.name',
'product_description' => 'mjpd.description',
'product_quantity' => 'case when mjp.quantity IS NULL or mjp.quantity < 0 then 0 else mjp.quantity end',
'product_code' => 'mjp.hika_sku',
'product_published' => 'mjp.status',
'product_hit' => 'mjp.viewed',
'product_created' => 'mjp.date_added',
'product_modified' => 'mjp.date_modified',
'product_sale_start' => 'mjp.date_available',
'product_tax_id' => 'hkc.category_id',
'product_type' => "'main'",
'product_url' => "''",
'product_weight' => 'mjp.weight',
'product_weight_unit' => "LOWER(mjwcd.unit)",
'product_dimension_unit' => "LOWER(mjlcd.unit)",
'product_min_per_order' => 'mjp.minimum',
'product_sales' => '0',
'product_width' => 'mjp.width',
'product_length' => 'mjp.length',
'product_height' => 'mjp.height',
'product_parent_id' => '0'
);
$sql1 = 'INSERT IGNORE INTO `#__hikashop_product` (`'.implode('`,`',array_keys($data)).'`) '.
'SELECT '.implode(',',$data).' FROM `#__mijoshop_product` AS mjp '.
'INNER JOIN `#__mijoshop_weight_class_description` mjwcd ON mjp.weight_class_id = mjwcd.weight_class_id '.
'INNER JOIN `#__mijoshop_length_class_description` mjlcd ON mjp.length_class_id = mjlcd.length_class_id '.
'INNER JOIN `#__mijoshop_product_description` mjpd ON mjp.product_id = mjpd.product_id '.
'LEFT JOIN `#__hikashop_taxation` hkt ON hkt.tax_mijo_id = mjp.tax_class_id '.
'LEFT JOIN `#__hikashop_category` hkc ON hkc.category_namekey = hkt.category_namekey '.
'LEFT JOIN `#__hikashop_mijo_prod` AS hkp ON mjp.product_id = hkp.mijo_id '.
'WHERE hkp.hk_id IS NULL ORDER BY mjp.product_id ASC;';