[Tep-j-general] Re: 特価商品の一括登録について

Back to archive index

Frank Black frank_black****@hotma*****
2006年 7月 4日 (火) 04:45:49 JST


こんにちは植松さん。

Frank Blackです。

>オプション部分の変更点の記述のみで・・・

Specialに関する変更部分は以下の通りです。
他バージョンのEPよりのソース移植ですので正しいかどうかわかりませんが、
手元では正常に動作しています。



EP_v2.61.2_MS1

477行目付近

			// support for Linda's Header Controller 2.0 here
			if(isset($filelayout['v_products_head_title_tag_' . $lid])){
				$row['v_products_head_title_tag_' . $lid] 	= 
$row2['products_head_title_tag'];
				$row['v_products_head_desc_tag_' . $lid] 	= 
$row2['products_head_desc_tag'];
				$row['v_products_head_keywords_tag_' . $lid] 	= 
$row2['products_head_keywords_tag'];
			}
			// end support for Header Controller 2.0
		}

の後に以下を追加

        // support for Specials here

        $sql4 = "SELECT *
            FROM ".TABLE_SPECIALS." 
            WHERE
                products_id = " . $row['v_products_id']
            ;
        $result4 = tep_db_query($sql4);
        $row4 =  tep_db_fetch_array($result4);
        
        if($row4['specials_new_products_price']){ 
$row['v_specials_new_products_price'] = 
round($row4['specials_new_products_price']); }
        else { $row['v_specials_new_products_price'] = ""; }
        $row['v_specials_expires_date']     = $row4['expires_date'];
        $row['v_specials_status']     = $row4['status'];

        // Now set the status to a word the user specd in the config vars
        if ( $row['v_specials_status'] == '0' ){
            $row['v_specials_status'] = $inactive;
        } elseif ( $row['v_specials_new_products_price'] ) {
            $row['v_specials_status'] = $active;
        }
        // end support for Specials

-------------------------------------------------------------------------------


971行目付近

		$filelayout  = tep_array_merge($filelayout , array(
			'v_products_price'		=> $iii++,
			'v_products_weight'		=> $iii++,
			'v_date_avail'			=> $iii++,
			'v_date_added'			=> $iii++,
			'v_products_quantity'		=> $iii++,
			#'v_customer_price_1'		=> $iii++,
			#'v_customer_group_id_1'		=> $iii++,
			#'v_customer_price_2'		=> $iii++,
			#'v_customer_group_id_2'		=> $iii++,
			#'v_customer_price_3'		=> $iii++,
			#'v_customer_group_id_3'		=> $iii++,
			#'v_customer_price_4'		=> $iii++,
			#'v_customer_group_id_4'		=> $iii++,
			'v_manufacturers_name'		=> $iii++,
			));

の後に以下を追加。

        // support for Specials here
        $filelayout = array_merge($filelayout , array(
            'v_specials_new_products_price'        => $iii++,
            'v_specials_expires_date'        => $iii++,
            'v_specials_status'        => $iii++,
            ));
        // end support for Specials

-------------------------------------------------------------------------------


1023行目付近

		// uncomment the customer_price and customer_group to support multi-price 
per product contrib
		$filelayout = array(
			'v_products_model'		=> $iii++,
			'v_products_price'		=> $iii++,
			'v_products_quantity'		=> $iii++,
			#'v_customer_price_1'		=> $iii++,
			#'v_customer_group_id_1'		=> $iii++,
			#'v_customer_price_2'		=> $iii++,
			#'v_customer_group_id_2'		=> $iii++,
			#'v_customer_price_3'		=> $iii++,
			#'v_customer_group_id_3'		=> $iii++,
			#'v_customer_price_4'		=> $iii++,
			#'v_customer_group_id_4'		=> $iii++,
				);

を以下のように変更。

		// uncomment the customer_price and customer_group to support multi-price 
per product contrib
		$filelayout = array(
			'v_products_model'		=> $iii++,
			'v_products_price'		=> $iii++,
			'v_products_quantity'		=> $iii++,
            'v_specials_new_products_price'        => $iii++,
            'v_specials_expires_date'        => $iii++,
            'v_specials_status'        => $iii++,
			#'v_customer_price_1'		=> $iii++,
			#'v_customer_group_id_1'		=> $iii++,
			#'v_customer_price_2'		=> $iii++,
			#'v_customer_group_id_2'		=> $iii++,
			#'v_customer_price_3'		=> $iii++,
			#'v_customer_group_id_3'		=> $iii++,
			#'v_customer_price_4'		=> $iii++,
			#'v_customer_group_id_4'		=> $iii++,
				);

---------------------------------------------------------------------------------


1376行目付近

        // so how to handle these?  we shouldn't built the array unless 
it's been giving to us.
	// The assumption is that if you give us names and descriptions, then you 
give us name and description for all applicable languages
	foreach ($langcode as $lang){
		//echo "Langid is " . $lang['id'] . "<br>";
		$l_id = $lang['id'];
		if (isset($filelayout['v_products_name_' . $l_id ])){
			//we set dynamically the language values
			$v_products_name[$l_id] 	= $items[$filelayout['v_products_name_' . 
$l_id]];
			$v_products_description[$l_id] 	= 
$items[$filelayout['v_products_description_' . $l_id ]];
			$v_products_url[$l_id] 		= $items[$filelayout['v_products_url_' . $l_id 
]];
			// support for Linda's Header Controller 2.0 here
			if(isset($filelayout['v_products_head_title_tag_' . $l_id])){
				$v_products_head_title_tag[$l_id] 	= 
$items[$filelayout['v_products_head_title_tag_' . $l_id]];
				$v_products_head_desc_tag[$l_id] 	= 
$items[$filelayout['v_products_head_desc_tag_' . $l_id]];
				$v_products_head_keywords_tag[$l_id] 	= 
$items[$filelayout['v_products_head_keywords_tag_' . $l_id]];
			}
			// end support for Header Controller 2.0
		}
	}

の後に以下を追加。

    // support for Specials here
    if(isset($filelayout['v_specials_new_products_price'])){
        $v_specials_new_products_price     = 
$items[$filelayout['v_specials_new_products_price']];
        $v_specials_expires_date     = 
$items[$filelayout['v_specials_expires_date']];
        $v_specials_status     = $items[$filelayout['v_specials_status']];
    }
    // end support for Specials

----------------------------------------------------------------------------------


1846行目付近

			if ($v_customer_price_4 != ''){
				$result = tep_db_query('
							INSERT INTO
								products_groups
							VALUES
							(
								' . $v_customer_group_id_4 . ',
								' . $v_customer_price_4 . ',
								' . $v_products_id . ',
								' . $v_products_price . '
								)'
							);
			}

		}

の後に以下を追加。

        // support for Specials here
        if (isset($v_specials_new_products_price) && $v_status != 
$deleteit){
            if ($v_specials_new_products_price != ''){
                $sql = "SELECT * FROM ".TABLE_SPECIALS." WHERE products_id 
= ".$v_products_id;
                $result = tep_db_query($sql);
                if (tep_db_num_rows($result) == 0) {
                    $result = tep_db_query('INSERT INTO '.TABLE_SPECIALS.' 
(products_id) VALUES (' .$v_products_id. ')');
                }
                if ($v_specials_expires_date == ''){ 
$v_specials_expires_date = "NULL"; }
                $v_specialsdb_status = '1'; // default to active
                if ($v_specials_status == $inactive){
                    // they told us to deactivate this item
                    $v_specialsdb_status = '0';
                }
                $sql = "UPDATE ".TABLE_SPECIALS." SET
                                specials_new_products_price = ". 
$v_specials_new_products_price .",
                                expires_date = '". $v_specials_expires_date 
."',
                                status = " . $v_specialsdb_status . " 
                            WHERE
                                products_id = '$v_products_id'";
                $result = tep_db_query($sql);
            } else {
                $result = tep_db_query('
                        DELETE
                        FROM
                            '.TABLE_SPECIALS.'
                        WHERE
                            products_id = ' . $v_products_id
                        );
            }
        }

        // end support for Specials


以上です。

_________________________________________________________________
パソコンでも携帯電話でも使える 「MSN Hotmail」 
http://promotion.msn.co.jp/hotmail/ 




Tep-j-general メーリングリストの案内
Back to archive index