예제 #1
0
         }
     }
 }
 foreach ($products_to_update as $pid) {
     $class_pm->updateDetail($pid, $gender, $agegroup);
     if ($addtoamvd == '1') {
         if ($amvdcatid == '0') {
             $catalog_id = $class_jc->addProduct('5', $pid);
             $amvdcatid = $catalog_id[0];
         }
         if ($amvdprice_new > 0) {
             $sda = array('price_new' => $amvdprice_new);
             $class_jc->updateField($amvdcatid, $sda);
         }
     }
     $class_pm->saveDescription($pid, $languages_id, $pname, $pdesc, $pkeys, $pshortname, null, null, $topicname, $colname, null, null);
     $pda['name'] = $pname;
     $pda['description'] = $pdesc;
     $pda['keywords'] = $pkeys;
     $pda['status_price'] = '1';
     //$pda['products_selling_points'] = $pspoint;
     $pda['short_name'] = $pshortname;
     tep_db_perform('jng_sp_catalog', $pda, 'update', "products_id={$pid}");
 }
 $class_pm->updateFlagContentImproved($products_id, $improved_content);
 $class_pm->updateFlagImageImproved($products_id, $improved_image);
 $product = new Product($products_id);
 $price_uvp = $product->getPriceUVP();
 $price_default = $product->getPriceDefault();
 $is_finalized = $pname != '' && $pdesc != '' && $price_uvp > 0 && $price_default > 0;
 if ($is_finalized) {
 $description = tep_db_prepare_input($_POST['description']);
 $keywords = tep_db_prepare_input($_POST['keywords']);
 $sellingpoints = tep_db_prepare_input($_POST['sellingpoints']);
 $sellingpointsamde = tep_db_prepare_input($_POST['sellingpointsamde']);
 $sellingpointslaid = tep_db_prepare_input($_POST['sellingpointslaid']);
 if ($sellingpointslaid != '') {
     if ($sellingpoints == '' && $languages_id == 3) {
         $sellingpoints = $sellingpointslaid;
     }
 }
 $promoname = tep_db_prepare_input($_POST['promoname']);
 $shortname = tep_db_prepare_input($_POST['shortname']);
 $topicname = tep_db_prepare_input($_POST['topicname']);
 $colname = tep_db_prepare_input($_POST['colname']);
 $keywords = $class_pm->keywordsParseRule($keywords);
 $class_pm->saveDescription($products_id, $languages_id, $name, $description, $keywords, $shortname, $sellingpoints, $promoname, $topicname, $colname, $sellingpointsamde);
 $q = tep_db_query("SELECT jc.jng_sp_id, jc.jng_sp_catalog_id, sp.languages_id FROM jng_sp_catalog jc LEFT JOIN jng_sp sp ON sp.jng_sp_id=jc.jng_sp_id WHERE jc.products_id={$products_id}");
 $sp_list = array();
 $sp_list_amazon = array();
 $sp_list_spid = array();
 $sp_used_selling_points_amde = array_keys(getSalesPartnerUseAmazonLogistic());
 while ($row = tep_db_fetch_array($q)) {
     if (in_array($row['jng_sp_id'], $sp_used_selling_points_amde)) {
         $sp_list_amazon[$row['jng_sp_catalog_id']] = $row['languages_id'];
     } else {
         $sp_list[$row['jng_sp_catalog_id']] = $row['languages_id'];
     }
     $sp_list_spid[$row['jng_sp_catalog_id']] = $row['jng_sp_id'];
 }
 //Update selling points which use non-amazon Selling Points
 foreach ($sp_list as $catalog_id => $sp_languages_id) {