엑셀로 상품등록시 옵션 같이 등록하기 > 팁앤테크

본문 바로가기
사이트 내 전체검색

팁앤테크

엑셀로 상품등록시 옵션 같이 등록하기

페이지 정보

본문

엑셀로 상품등록시 옵션 같이 등록하기

사용조건

옵션별 추가금액(0) 재고수량(9999) 통보수량(100) 사용여부(1)는 고정합니다.

 

일반적인 사이즈나 색상만을 사용할 경우 아래코드를 사용해 주세요.

 

itemexcelupdate.php

//--------------------------------

$it_option_subject = addslashes((string)$rowData[0][$j++]);
$it_opt1 = addslashes((string)$rowData[0][$j++]);
$it_opt2 = addslashes((string)$rowData[0][$j++]);
$it_opt3 = addslashes((string)$rowData[0][$j++]);
$it_explan2         = strip_tags(trim($it_explan));

 

 


       $sql = " INSERT INTO {$g5['g5_shop_item_table']}
                    SET it_id = '$it_id',
                        ca_id = '$ca_id',
                        ca_id2 = '$ca_id2',
                        ca_id3 = '$ca_id3',
                        it_name = '$it_name',
                        it_maker = '$it_maker',
                        it_origin = '$it_origin',
                        it_brand = '$it_brand',
                        it_model = '$it_model',
                        it_type1 = '$it_type1',
                        it_type2 = '$it_type2',
                        it_type3 = '$it_type3',
                        it_type4 = '$it_type4',
                        it_type5 = '$it_type5',
                        it_basic = '$it_basic',
                        it_explan = '$it_explan',
                        it_explan2 = '$it_explan2',
                        it_mobile_explan = '$it_mobile_explan',
                        it_cust_price = '$it_cust_price',
                        it_price = '$it_price',
                        it_point = '$it_point',
                        it_point_type = '$it_point_type',
                        it_stock_qty = '$it_stock_qty',
                        it_noti_qty = '$it_noti_qty',
                        it_buy_min_qty = '$it_buy_min_qty',
                        it_buy_max_qty = '$it_buy_max_qty',
                        it_notax = '$it_notax',
                        it_use = '$it_use',
                        it_time = '".G5_TIME_YMDHIS."',
                        it_ip = '{$_SERVER['REMOTE_ADDR']}',
                        it_order = '$it_order',
                        it_tel_inq = '$it_tel_inq',
                        it_option_subject = '$it_option_subject',
                        it_img1 = '$it_img1',
                        it_img2 = '$it_img2',
                        it_img3 = '$it_img3',
                        it_img4 = '$it_img4',
                        it_img5 = '$it_img5',
                        it_img6 = '$it_img6',
                        it_img7 = '$it_img7',
                        it_img8 = '$it_img8',
                        it_img9 = '$it_img9',
                        it_img10 = '$it_img10' ";

       sql_query($sql);

       $succ_count++;


       //-------------------------------------------
       $po_run = false;

       $opt1_val = isset($it_opt1) ? preg_replace(G5_OPTION_ID_FILTER, '', trim(stripslashes($it_opt1))) : '';
       $opt2_val = isset($it_opt2) ? preg_replace(G5_OPTION_ID_FILTER, '', trim(stripslashes($it_opt2))) : '';
       $opt3_val = isset($it_opt3) ? preg_replace(G5_OPTION_ID_FILTER, '', trim(stripslashes($it_opt3))) : '';

       $po_run = true;

       $opt1_count = $opt2_count = $opt3_count = 0;

       if($opt1_val) {
           $opt1 = explode(',', $opt1_val);
           $opt1_count = count($opt1);
       }

       if($opt2_val) {
           $opt2 = explode(',', $opt2_val);
           $opt2_count = count($opt2);
       }

       if($opt3_val) {
           $opt3 = explode(',', $opt3_val);
           $opt3_count = count($opt3);
       }

       if($po_run) {
       // 옵션
       sql_query(" delete from {$g5['g5_shop_item_option_table']} where it_id = '$it_id' "); // 기존옵션삭제

           for($o=0; $o<$opt1_count; $o++) {
               $p = 0;
               do {
                   $q = 0;
                   do {
                       $opt_1 = isset($opt1[$o]) ? strip_tags(trim($opt1[$o])) : '';
                       $opt_2 = isset($opt2[$p]) ? strip_tags(trim($opt2[$p])) : '';
                       $opt_3 = isset($opt3[$q]) ? strip_tags(trim($opt3[$q])) : '';

                       $opt_2_len = strlen($opt_2);
                       $opt_3_len = strlen($opt_3);

                       $opt_id = $opt_1;
                       if($opt_2_len)
                           $opt_id .= chr(30).$opt_2;
                       if($opt_3_len)
                           $opt_id .= chr(30).$opt_3;
                       $opt_price = 0;
                       $opt_stock_qty = 9999;
                       $opt_noti_qty = 100;
                       $opt_use = 1;

                       $option_count = (isset($opt_id) && is_array($opt_id)) ? count($opt_id) : array();

                       // 선택옵션등록
                       $comma = '';
                       $sql = " INSERT INTO {$g5['g5_shop_item_option_table']}
                                       ( `io_id`, `io_type`, `it_id`, `io_price`, `io_stock_qty`, `io_noti_qty`, `io_use` )
                                   VALUES ";
                           $sql .= $comma . " ( '".sql_real_escape_string($opt_id)."', '0', '$it_id', '0', '9999', '100', '1' )";
                           $comma = ' , ';

                       sql_query($sql);

                       $q++;
                   } while($q < $opt3_count);

                   $p++;
               } while($p < $opt2_count);
           } // for
       }
       //-------------------------------------------

 

추천0

첨부파일

댓글목록

등록된 댓글이 없습니다.

Total 825건 32 페이지
  • RSS
팁앤테크 목록
번호 제목 글쓴이 조회 추천 날짜
50 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 16394 0 12-27
49 hongx2쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 13788 0 12-25
48 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 17551 0 12-06
47 월드컵쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 19819 0 12-03
46 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 15621 0 11-21
45 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 14383 0 11-21
44 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 15592 0 11-17
43 창호지쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 16585 0 11-14
42 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 15054 0 11-10
41 디란도쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 14699 0 11-09
40 디란도쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 14893 0 11-08
39 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 17846 0 11-07
38 백작쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 15450 0 11-03
37 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 14946 0 11-01
36 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 19032 0 11-01
35 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 16986 0 11-01
34 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 17852 0 11-01
33 미믹스쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 14526 0 10-26
32 디란도쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 14414 0 10-26
31 귀여운현호쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 14000 0 10-24
30 귀여운현호쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 17369 0 10-24
29 귀여운현호쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 14265 0 10-24
28 귀여운현호쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 14959 0 10-23
27 귀여운현호쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 13562 0 10-23
26 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 17199 0 10-22

검색

회원로그인

회원가입

사이트 정보

株式会社YHPLUS / 대표 : ZERO
〒140-0011 東京都品川区東大井2-5-9-203
050-5539-7787
오픈카카오톡 (YHPLUS) :
https://open.kakao.com/o/slfDj15d

접속자집계

오늘
1,843
어제
7,395
최대
8,371
전체
1,665,163
Copyright (c) 株式会社YHPLUS. All rights reserved.