Plugin Directory

Changeset 1984670


Ignore:
Timestamp:
12/03/2018 07:05:09 PM (7 years ago)
Author:
hands01
Message:

release version 1.0.1

Location:
e-shops-cart2/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • e-shops-cart2/trunk/cart/eshops-cart2-source-create.php

    r1792481 r1984670  
    1818    //const HTTPS_PATH = 'https://192.168.254.210/cart_step';
    1919    const HTTPS_PATH = 'https://cart.ec-sites.jp/cart_step';
     20   
     21    //const SP_HTTPS_PATH = 'http://192.168.254.210/sp_step';
     22    const SP_HTTP_PATH = 'http://cart.ec-sites.jp/sp_step';
     23    //const SP_HTTPS_PATH = 'https://192.168.254.210/sp_step';
     24    const SP_HTTPS_PATH = 'https://cart.ec-sites.jp/sp_step';
    2025
    2126    //const TK_HTTP_PATH = 'http://192.168.254.210/tk_step';
     
    513518     * @return string
    514519     */
    515     public function create_tk_action() {
    516         return "<form method=\"post\" action=\"" . Kago_Source_Define::TK_HTTP_PATH . "/pc/pk00/\">\n";
     520    public function create_tk_action($kago_url) {
     521        return "<form method=\"post\" action=\"" . $kago_url . "\">\n";
     522    }
     523   
     524    /**
     525     * Create sp form action.
     526     *
     527     * @return string
     528     */
     529    public function create_sp_action($kago_url) {
     530        return "<form method=\"post\" action=\"" . $kago_url . "\">\n";
    517531    }
    518532
  • e-shops-cart2/trunk/eshops-cart2.php

    r1792481 r1984670  
    432432    }
    433433   
     434    /**
     435     * Get sp kago url.
     436     *
     437     * @return mixed|boolean
     438     */
     439    public function get_api_sp_kago_url() {
     440        $api_key = '';
     441       
     442        $db_param = get_option( 'ec2_settings' );
     443        if ( $db_param ) {
     444            $param = unserialize( $db_param );
     445           
     446            if ( isset( $param['api_key'] ) && $param['api_key'] ) {
     447                $api_key = $param['api_key'];
     448            }
     449        }
     450       
     451        if ( $api_key ) {
     452            $url = self::EC2_API_SERVER . "plugin/get-sp-kago-url/";
     453            $args = array(
     454                'timeout' => 5,
     455                'body' => array(
     456                    'apikey' => $api_key,
     457                )
     458            );
     459        } else {
     460            echo 'api_key is not found.';
     461            exit;
     462        }
     463       
     464        $response = wp_remote_post( $url, $args );
     465       
     466        if ( is_array( $response ) ) {
     467            if ( 200 === $response['response']['code'] ) {
     468                // Status is OK.
     469                if ( isset( $response['body'] ) && $response['body'] ) {
     470                    $url = json_decode( $response['body'] );
     471                    return $url;
     472                }
     473            } else {
     474                // Status is NG.
     475                echo 'status is not 200.';
     476                exit;
     477            }
     478        } else {
     479            // Response error.
     480            echo Eshops_Cart2_Html::message_errors( $response->get_error_messages() );
     481        }
     482       
     483        return false;
     484    }
     485   
     486    /**
     487     * Get tk kago url.
     488     *
     489     * @return mixed|boolean
     490     */
     491    public function get_api_tk_kago_url() {
     492        $api_key = '';
     493       
     494        $db_param = get_option( 'ec2_settings' );
     495        if ( $db_param ) {
     496            $param = unserialize( $db_param );
     497           
     498            if ( isset( $param['api_key'] ) && $param['api_key'] ) {
     499                $api_key = $param['api_key'];
     500            }
     501        }
     502       
     503        if ( $api_key ) {
     504            $url = self::EC2_API_SERVER . "plugin/get-tk-kago-url/";
     505            $args = array(
     506                'timeout' => 5,
     507                'body' => array(
     508                    'apikey' => $api_key,
     509                )
     510            );
     511        } else {
     512            echo 'api_key is not found.';
     513            exit;
     514        }
     515       
     516        $response = wp_remote_post( $url, $args );
     517       
     518        if ( is_array( $response ) ) {
     519            if ( 200 === $response['response']['code'] ) {
     520                // Status is OK.
     521                if ( isset( $response['body'] ) && $response['body'] ) {
     522                    $url = json_decode( $response['body'] );
     523                    return $url;
     524                }
     525            } else {
     526                // Status is NG.
     527                echo 'status is not 200.';
     528                exit;
     529            }
     530        } else {
     531            // Response error.
     532            echo Eshops_Cart2_Html::message_errors( $response->get_error_messages() );
     533        }
     534       
     535        return false;
     536    }
     537   
    434538    public function get_api_shop_base( $api_key ) {
    435539        if ( $api_key ) {
     
    558662                $tmpl_html =<<<EOM
    559663<h3>[ec2_item_name]</h3>
    560 [ec2_tk_start_form][ec2_item_attr]<br>
     664[ec2_start_form][ec2_item_attr]<br>
    561665[ec2_item_attr]<br>
    562666[ec2_item_attr_sel]<br>
    563667[ec2_item_attr_text]<br>
    564668[ec2_item_option]<br>
    565 [ec2_item_qty]  [ec2_tk_kago][ec2_end_form]
     669[ec2_item_qty]  [ec2_kago][ec2_end_form]
    566670商品コード:[ec2_item_code]
    567671売価:[ec2_item_price]円
  • e-shops-cart2/trunk/html/eshops-cart2-html.php

    r1792481 r1984670  
    4848        $html .= '<div class="wrap">' . "\n";
    4949        $html .= '  <h1>' . esc_html__( '設定', EC2_TEXTDOMAIN ) . '</h1>' . "\n";
    50         $html .= $param['description']->wordpress_description;
    5150        $html .= '  <form method="post">' . "\n";
    5251        $html .= '  ' . wp_nonce_field( 'ec2_settings', 'ec2_csrf', true, false ) . "\n";
     
    219218[ec2_item_qty]  [ec2_kago][ec2_end_form]
    220219EOM;
     220       
     221        $recommend_sp_kago = <<<EOM
     222[ec2_sp_start_form][ec2_item_attr]<br>
     223[ec2_item_attr]<br>
     224[ec2_item_attr_sel]<br>
     225[ec2_item_attr_text]<br>
     226[ec2_item_option]<br>
     227[ec2_item_qty]  [ec2_kago][ec2_end_form]
     228EOM;
     229       
    221230        $recommend_tk_kago =<<<EOM
    222231[ec2_tk_start_form][ec2_item_attr]<br>
     
    286295        $html .= '  </div>' . "\n";
    287296        $html .= '  <div id="cart2Etab5">' . "\n";
    288         $html .= '   ■カゴに入れるボタンセット   :<br />' . "\n";
     297        $html .= '   ■カゴに入れるボタンセット(通常カゴ用):<br />' . "\n";
    289298        $html .= '   <textarea id="ec2_kago_all" style="width:500px;" rows="8" readonly="readonly">' . $recommend_kago . '</textarea><br />' . "\n";
    290299        $html .= '   <button type="button" class="clip_copy_btn button" data-clipboard-target="#ec2_kago_all" >コピー</button><br />' . "\n";
    291300        $html .= '   <br />' . "\n";
    292301        $html .= '   <br />' . "\n";
    293         $html .= '   ■通常カゴに入れるボタン    :<input type="text" id="ec2_kago" value="[ec2_kago]" readonly="readonly"> <button type="button" class="clip_copy_btn button" data-clipboard-target="#ec2_kago" >コピー</button><br />' . "\n";
    294         $html .= '   ■フォーム開始タグ(通常カゴ用):<input type="text" id="ec2_start_form2" value="[ec2_start_form]" readonly="readonly"> <button type="button" class="clip_copy_btn button" data-clipboard-target="#ec2_start_form2" >コピー</button><br />' . "\n";
    295         $html .= '   ■フォーム終了タグ       :<input type="text" id="ec2_end_form" value="[ec2_end_form]" readonly="readonly"> <button type="button" class="clip_copy_btn button" data-clipboard-target="#ec2_end_form" >コピー</button><br />' . "\n";
    296         $html .= '   ■数量指定フォーム       :<input type="text" id="ec2_item_qty" value="[ec2_item_qty]" readonly="readonly"> <button type="button" class="clip_copy_btn button" data-clipboard-target="#ec2_item_qty" >コピー</button><br />' . "\n";
    297         $html .= '   ■単純属性           :<input type="text" id="ec2_item_attr" value="[ec2_item_attr]" readonly="readonly"> <button type="button" class="clip_copy_btn button" data-clipboard-target="#ec2_item_attr" >コピー</button><br />' . "\n";
    298         $html .= '   ■属性別在庫          :<input type="text" id="ec2_item_attr_sel" value="[ec2_item_attr_sel]" readonly="readonly"> <button type="button" class="clip_copy_btn button" data-clipboard-target="#ec2_item_attr_sel" >コピー</button><br />' . "\n";
    299         $html .= '   ■テキスト入力属性       :<input type="text" id="ec2_item_attr_text" value="[ec2_item_attr_text]" readonly="readonly"> <button type="button" class="clip_copy_btn button" data-clipboard-target="#ec2_item_attr_text" >コピー</button><br />' . "\n";
    300         $html .= '   ■オプション          :<input type="text" id="ec2_item_option" value="[ec2_item_option]" readonly="readonly"> <button type="button" class="clip_copy_btn button" data-clipboard-target="#ec2_item_option" >コピー</button><br />' . "\n";
     302        $html .= '   ■カゴに入れるボタンセット(スマホカゴ用):<br />' . "\n";
     303        $html .= '   <textarea id="ec2_sp_kago_all" style="width:500px;" rows="8" readonly="readonly">' . $recommend_sp_kago . '</textarea><br />' . "\n";
     304        $html .= '   <button type="button" class="clip_copy_btn button" data-clipboard-target="#ec2_sp_kago_all" >コピー</button><br />' . "\n";
     305        $html .= '   <br />' . "\n";
     306        $html .= '   <br />' . "\n";
     307        $html .= '   ■通常カゴに入れるボタン     :<input type="text" id="ec2_kago" value="[ec2_kago]" readonly="readonly"> <button type="button" class="clip_copy_btn button" data-clipboard-target="#ec2_kago" >コピー</button><br />' . "\n";
     308        $html .= '   ■フォーム開始タグ(通常カゴ用) :<input type="text" id="ec2_start_form2" value="[ec2_start_form]" readonly="readonly"> <button type="button" class="clip_copy_btn button" data-clipboard-target="#ec2_start_form2" >コピー</button><br />' . "\n";
     309        $html .= '   ■フォーム開始タグ(スマホカゴ用):<input type="text" id="ec2_sp_start_form2" value="[ec2_sp_start_form]" readonly="readonly"> <button type="button" class="clip_copy_btn button" data-clipboard-target="#ec2_sp_start_form2" >コピー</button><br />' . "\n";
     310        $html .= '   ■フォーム終了タグ        :<input type="text" id="ec2_end_form" value="[ec2_end_form]" readonly="readonly"> <button type="button" class="clip_copy_btn button" data-clipboard-target="#ec2_end_form" >コピー</button><br />' . "\n";
     311        $html .= '   ■数量指定フォーム        :<input type="text" id="ec2_item_qty" value="[ec2_item_qty]" readonly="readonly"> <button type="button" class="clip_copy_btn button" data-clipboard-target="#ec2_item_qty" >コピー</button><br />' . "\n";
     312        $html .= '   ■単純属性            :<input type="text" id="ec2_item_attr" value="[ec2_item_attr]" readonly="readonly"> <button type="button" class="clip_copy_btn button" data-clipboard-target="#ec2_item_attr" >コピー</button><br />' . "\n";
     313        $html .= '   ■属性別在庫           :<input type="text" id="ec2_item_attr_sel" value="[ec2_item_attr_sel]" readonly="readonly"> <button type="button" class="clip_copy_btn button" data-clipboard-target="#ec2_item_attr_sel" >コピー</button><br />' . "\n";
     314        $html .= '   ■テキスト入力属性        :<input type="text" id="ec2_item_attr_text" value="[ec2_item_attr_text]" readonly="readonly"> <button type="button" class="clip_copy_btn button" data-clipboard-target="#ec2_item_attr_text" >コピー</button><br />' . "\n";
     315        $html .= '   ■オプション           :<input type="text" id="ec2_item_option" value="[ec2_item_option]" readonly="readonly"> <button type="button" class="clip_copy_btn button" data-clipboard-target="#ec2_item_option" >コピー</button><br />' . "\n";
    301316        $html .= '  </div>' . "\n";
    302317        $html .= ' </div>' . "\n";
  • e-shops-cart2/trunk/readme.txt

    r1792490 r1984670  
    33Tags:  store, sales, sell, shop, cart
    44Requires at least: 4.4.0
    5 Tested up to: 4.9.1
    6 Stable tag: 1.0.0
     5Tested up to: 4.9.8
     6Stable tag: 1.0.1
    77License: GPLv3
    88License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    6666= 1.0.0 - 2017-12-26 =
    6767* ベータテスト版公開
     68
     69= 1.0.1 - 2018-12-04 =
     70* スマホカゴ対応
  • e-shops-cart2/trunk/shortcodes/eshops-cart2-shortcodes.php

    r1792481 r1984670  
    4747     */
    4848    private $kago_url;
     49   
     50    /**
     51     * EshopsCart2 Sp kago url.
     52     *
     53     * @var string
     54     */
     55    private $sp_kago_url;
     56   
     57    /**
     58     * EshopsCart2 Tk kago url.
     59     *
     60     * @var string
     61     */
     62    private $tk_kago_url;
    4963
    5064    /**
     
    127141            'ec2_item_contact'         => 'item_contact',
    128142            'ec2_start_form'           => 'start_form',
     143            'ec2_sp_start_form'        => 'sp_start_form',
    129144            'ec2_tk_start_form'        => 'tk_start_form',
    130145            'ec2_end_form'             => 'end_form',
     
    236251           
    237252            if( $tmpl_option['sale_period_disp_flag'] == 2 || $this->item_data['itemData']['item_sale_flag'] == 0 || ( strtotime( $now ) >= strtotime( $this->item_data['itemData']['item_start_date'] ) && strtotime( $now ) <= strtotime( $this->item_data['itemData']['item_end_date'] ) ) ){
    238            
    239                 if ( ! $this->kago_url ) {
    240                     $kagoUrl = EC2()->get_api_kago_url();
    241                     $this->kago_url = $kagoUrl->kago;
    242                 }
    243            
    244253                $kago_src = new Source_Create( $this->shop_id, $this->item_data );
    245254               
     
    270279           
    271280            if( $tmpl_option['sale_period_disp_flag'] == 2 || $this->item_data['itemData']['item_sale_flag'] == 0 || ( strtotime( $now ) >= strtotime( $this->item_data['itemData']['item_start_date'] ) && strtotime( $now ) <= strtotime( $this->item_data['itemData']['item_end_date'] ) ) ){
    272            
    273                 if ( ! $this->kago_url ) {
    274                     $kagoUrl = EC2()->get_api_kago_url();
    275                     $this->kago_url = $kagoUrl->kago;
    276                 }
    277            
    278281                $kago_src = new Source_Create( $this->shop_id, $this->item_data );
    279282               
     
    993996       
    994997        if ( $this->item_data ) {
    995             if ( ! $this->kago_url ) {
    996                 $kagoUrl = EC2()->get_api_kago_url();
    997                 $this->kago_url = $kagoUrl->kago;
    998             }
    999            
     998            if ( ! $this->kago_url ) {
     999                $kagoUrl = EC2()->get_api_kago_url();
     1000                $this->kago_url = $kagoUrl->kago;
     1001            }
     1002           
    10001003            $tmpl_option = unserialize( $this->tmpl_data['tmpl_option'] );
    10011004           
     
    10121015   
    10131016    /**
     1017     * Create sp start form.
     1018     * @return string
     1019     */
     1020    public function sp_start_form(){
     1021        $html = '';
     1022       
     1023        if ( $this->item_data ) {
     1024            if ( ! $this->sp_kago_url ) {
     1025                $kagoUrl = EC2()->get_api_sp_kago_url();
     1026                $this->sp_kago_url = $kagoUrl->kago;
     1027            }
     1028           
     1029            $tmpl_option = unserialize( $this->tmpl_data['tmpl_option'] );
     1030           
     1031            $now = date("Y-m-d");
     1032           
     1033            if( $tmpl_option['sale_period_disp_flag'] == 2 || $this->item_data['itemData']['item_sale_flag'] == 0 || ( strtotime( $now ) >= strtotime( $this->item_data['itemData']['item_start_date'] ) && strtotime( $now ) <= strtotime( $this->item_data['itemData']['item_end_date'] ) ) ){
     1034                $kago_src = new Source_Create( $this->shop_id, $this->item_data );
     1035                $html = $kago_src->create_sp_action( $this->sp_kago_url );
     1036            }
     1037        }
     1038       
     1039        return $html;
     1040    }
     1041   
     1042    /**
    10141043     * Create tk start form.
    10151044     * @return string
     
    10191048       
    10201049        if ( $this->item_data ) {
    1021             if ( ! $this->kago_url ) {
    1022                 $kagoUrl = EC2()->get_api_kago_url();
    1023                 $this->kago_url = $kagoUrl->kago;
     1050            if ( ! $this->tk_kago_url ) {
     1051                $kagoUrl = EC2()->get_api_tk_kago_url();
     1052                $this->tk_kago_url = $kagoUrl->kago;
    10241053            }
    10251054           
     
    10301059            if( $tmpl_option['sale_period_disp_flag'] == 2 || $this->item_data['itemData']['item_sale_flag'] == 0 || ( strtotime( $now ) >= strtotime( $this->item_data['itemData']['item_start_date'] ) && strtotime( $now ) <= strtotime( $this->item_data['itemData']['item_end_date'] ) ) ){
    10311060                $kago_src = new Source_Create( $this->shop_id, $this->item_data );
    1032                 $html = $kago_src->create_tk_action( $this->kago_url );
     1061                $html = $kago_src->create_tk_action( $this->tk_kago_url );
    10331062            }
    10341063        }
Note: See TracChangeset for help on using the changeset viewer.