[未解決] is_item_zaikoでエラー

フォーラム バグ報告 [未解決] is_item_zaikoでエラー

  • このトピックには2件の返信、2人の参加者があり、最後にmint1414により10年、 6ヶ月前に更新されました。
3件の投稿を表示中 - 1 - 3件目 (全3件中)
  • 投稿者
    投稿
  • #55310
    mint1414
    参加者

    動作に関するご質問の場合は必ずご記入ください。


    WordPress のバージョン:3.6.1

    Welcart のバージョン:1.3.5

    ご利用のテーマ:Welcart_Default

    症状を確認したブラウザ:Chrome

    サーバー(会社名、サービス名):

    SSLの利用: 無し | 専用SSL | 共用SSL

    WordPress のパーマリンク設定:


    お世話になります。

    商品詳細ページ(wc_item_single.php)を下記のように変更したところ、

    エラーが出るようになってしまいました。

    「Warning: trim() expects parameter 1 to be string, array given in G:InstantWP_4.3.1iwpserverhtdocswordpresswp-contentpluginsusc-e-shopclassesusceshop.class.php on line 6116」

    上記は、ローカルのエラーですが本番環境でも同様にエラーを確認しています。

    そこで、上記ファイルを確認すると、

    function is_item_zaiko( $post_id, $sku )内の、$zaiko_num = trim($this->getItemZaikoNum($post_id, $sku));

    でエラーになっていると考えて、trim関数をはずしたらエラーは

    出なくなったのですが、根本的な解決になっていないと思いますので

    どうぞよろしくお願いいたします。

    <wc_item_single.php変更分>

    <div id="content">
    <div id="frame3">
    <div id="plist">
    <ul><li><a href="<?php echo home_url(); ?>/">HOME</a></li>
    <?php $cats = get_ordered_category();?>
    <?php foreach ($cats as $cat):?>
    <?php if ($cat -> parent != 0 && $cat -> parent !=17) {?>
    <li>></li>
    <li><?php echo $cat -> name;?></li>
    <?php }?>
    <?php endforeach; ?>
    </ul>
    </div><!-- end of plist -->

    <?php if (have_posts()) : the_post(); ?>

    <div class="item_img">
    <a href="<?php the_permalink(); ?>" rel="<?php usces_the_itemImageURL(0); ?>" class="zoom"><?php /*usces_the_itemImage(0, 600, 500);*/ ?><img src="<?php usces_the_itemImageURL(1); ? />" /></a>
    <div class="item_thumimg">
    <?php $imageid = usces_get_itemSubImageNums(); ?>
    <?php foreach ( $imageid as $id ) : ?>
    <a href="<?php usces_the_itemImageURL($id); ?>" <?php echo apply_filters('usces_itemimg_anchor_rel', NULL); ?>><img src="<?php usces_the_itemImageURL($id); ? />" /></a>
    <?php endforeach; ?>
    </div><!-- end of .item_thumimg -->
    </div><!-- end of .item_img -->

    <div class="storycontent">

    <?php usces_remove_filter(); ?>
    <?php usces_the_item(); ?>
    <div id="item_page1">
    <div class="top1">
    <p class="item_name"><?php usces_the_itemName(); ?></p>
    <?php if(usces_sku_num() > 0) : usces_have_skus(); ?>
    <!-- <div class="exp clearfix"> -->
    <!-- <div class="field"> -->
    <!-- 販売価格がある場合は、販売価格を表示・ない場合は定価を表示 -->
    <?php if( usces_the_itemPrice('return') > 0 ) : ?>
    <div class="item_nameprice"><?php usces_the_itemPriceCr(); ?><?php usces_guid_tax(); ?></div>
    <?php else: ?>
    <div class="item_nameprice"><?php usces_the_itemCpriceCr(); ?><?php usces_guid_tax(); ?></div>
    <?php endif; ?>

    <!-- </div> -->
    <div class="field"><?php /*_e('stock status', 'usces'); ?> : <?php usces_the_itemZaikoStatus();*/ ?></div>
    <div class="contents">
    <?php remove_filter ('the_content', 'wpautop'); ?>
    <p class="contentcolor"><?php the_content(); ?></p>
    </div><!-- end of .contents -->
    <!-- </div><!-- end of exp -->
    <?php endif; ?>
    </div><!-- end of .top1 -->
    </div><!-- end of #item_page1 -->
    <?php else: ?>
    <div id="item_page1">
    <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
    </div><!-- end of #item_page1 -->
    <?php endif; ?>

    <?php if(usces_sku_num() === 1) : usces_have_skus(); ?>
    <!--1SKU-->
    <div id="item_page2">
    <div class="top1"></div>
    <?php if( $item_custom = usces_get_item_custom( $post->ID, 'list', 'return' ) ) : ?>
    <div class="contents">
    <div class="field"><?php echo $item_custom; ?></div>
    </div><!-- end of .contents -->
    <?php endif; ?>
    <form action="<?php echo USCES_CART_URL; ?>" method="post">
    <?php usces_the_itemGpExp(); ?>
    <div class="skuform" align="right">
    <?php if (usces_is_options()) : ?>
    <table class='item_option'>
    <caption><?php _e('Please appoint an option.', 'usces'); ?></caption>
    <?php while (usces_have_options()) : ?>
    <tr><th><?php usces_the_itemOptName(); ?></th><td><?php usces_the_itemOption(usces_getItemOptName(),''); ?></td></tr>
    <?php endwhile; ?>
    </table>
    <?php endif; ?>

    <?php if( !usces_have_zaiko()) : ?>
    <div class="zaiko_status"><?php echo apply_filters('usces_filters_single_sku_zaiko_message', esc_html(usces_get_itemZaiko( 'name' ))); ?></div>
    <?php else: ?>
    <div style="margin-top:10px"><?php _e('Quantity', 'usces'); ?><?php usces_the_itemQuant(); ?><?php usces_the_itemSkuUnit(); ?><?php usces_the_itemSkuButton(__('Add to Shopping Cart', 'usces'), 0); ?></div>
    <div class="error_message"><?php usces_singleitem_error_message($post->ID, usces_the_itemSku('return')); ?></div>
    <?php endif; ?>
    </div><!-- end of skuform -->
    <?php echo apply_filters('single_item_single_sku_after_field', NULL); ?>
    <?php do_action('usces_action_single_item_inform'); ?>
    </form>
    <?php do_action('usces_action_single_item_outform'); ?>
    </div><!-- end of #item_page2 -->
    <?php elseif(usces_sku_num() > 1) : usces_have_skus(); ?>
    <!--some SKU-->
    <div id="item_page2">
    <div class="top1"></div>
    <?php if( $item_custom = usces_get_item_custom( $post->ID, 'list', 'return' ) ) : ?>
    <div class="contents">
    <div class="field"><?php echo $item_custom; ?></div>
    </div><!-- end of .contents -->
    <?php endif; ?>
    <form action="<?php echo USCES_CART_URL; ?>" method="post">
    <div class="skuform">
    <table class="skumulti">
    <thead>
    <tr>
    <th rowspan="2" class="thborder"><?php _e('order number', 'usces'); ?></th>
    <th colspan="2"><?php _e('Title', 'usces'); ?></th>
    <?php if( usces_the_itemCprice('return') > 0 ) : ?>
    <th colspan="2">(<?php _e('List price', 'usces'); ?>)<?php _e('selling price', 'usces'); ?><?php usces_guid_tax(); ?></th>
    <?php else : ?>
    <th colspan="2"><?php _e('selling price', 'usces'); ?><?php usces_guid_tax(); ?></th>
    <?php endif; ?>
    </tr>
    <tr>
    <th class="thborder"><?php _e('stock status', 'usces'); ?></th>
    <th class="thborder"><?php _e('Quantity', 'usces'); ?></th>
    <th class="thborder"><?php _e('unit', 'usces'); ?></th>
    <th class="thborder">&nbsp;</th>
    </tr>
    </thead>
    <tbody>
    <?php do { ?>
    <tr>
    <td rowspan="2"><?php usces_the_itemSku(); ?></td>
    <td colspan="2" class="skudisp subborder"><?php usces_the_itemSkuDisp(); ?>
    <?php if (usces_is_options()) : ?>
    <table class='item_option'>
    <caption><?php _e('Please appoint an option.', 'usces'); ?></caption>
    <?php while (usces_have_options()) : ?>
    <tr>
    <th><?php usces_the_itemOptName(); ?></th>
    <td><?php usces_the_itemOption(usces_getItemOptName(),''); ?></td>
    </tr>
    <?php endwhile; ?>
    </table>
    <?php endif; ?>
    </td>
    <td colspan="2" class="subborder price">
    <?php if( usces_the_itemCprice('return') > 0 ) : ?>
    <span class="cprice">(<?php usces_the_itemCpriceCr(); ?>)</span>
    <?php endif; ?>
    <span class="price"><?php usces_the_itemPriceCr(); ?></span>
    <br /><?php usces_the_itemGpExp(); ?>
    </td>
    </tr>
    <tr>
    <td class="zaiko"><?php usces_the_itemZaikoStatus(); ?></td>
    <td class="quant"><?php usces_the_itemQuant(); ?></td>
    <td class="unit"><?php usces_the_itemSkuUnit(); ?></td>
    <?php if( !usces_have_zaiko() ) : ?>
    <td class="button"><?php echo apply_filters('usces_filters_multi_sku_zaiko_message', esc_html(usces_get_itemZaiko( 'name' ))); ?></td>
    <?php else : ?>
    <td class="button"><?php usces_the_itemSkuButton(__('Add to Shopping Cart', 'usces'), 0); ?></td>
    <?php endif; ?>
    </tr>
    <tr>
    <td colspan="5" class="error_message"><?php usces_singleitem_error_message($post->ID, usces_the_itemSku('return')); ?></td>
    </tr>

    <?php } while (usces_have_skus()); ?>
    </tbody>
    </table>
    </div><!-- end of skuform -->
    <?php echo apply_filters('single_item_multi_sku_after_field', NULL); ?>
    <?php do_action('usces_action_single_item_inform'); ?>
    </form>
    <?php do_action('usces_action_single_item_outform'); ?>
    </div><!-- end of #item_page2 -->
    <?php endif; ?>
    <?php usces_assistance_item( $post->ID, __('An article concerned', 'usces') ); ?>

    </div><!-- end of .storycontent -->
    </div><!-- end of #frame3 -->
    </div><!-- end of content -->

    #67639
    nanbu
    キーマスター

    こんにちは。

    ご指摘のtrimは、Welcartのバグです。次期バージョンではこのtrimを外してリリースしたいと思います。ご報告ありがとうございます。

    #67640
    mint1414
    参加者

    お返事ありがとうございます。

    バグなんですね。私が順番を入れ替えたりしたので

    変数の値がおかしくなったんじゃないかと思いました。

    とりあえずは、trimをはずした状態でいいと言うことですね。

3件の投稿を表示中 - 1 - 3件目 (全3件中)
  • このトピックに返信するにはログインが必要です。