返信先: 商品詳細画面の数量入力フィールドをプルダウンメニューに変更できない

フォーラム その他 商品詳細画面の数量入力フィールドをプルダウンメニューに変更できない 返信先: 商品詳細画面の数量入力フィールドをプルダウンメニューに変更できない

#69895
hiyo
参加者

nanbu 様

ご連絡ありがとうございます。
該当すると思われる箇所をコードを記載致しますので、
恐れ入りますがご確認の程よろしくお願い致します。

【functions.php】
function bks_the_itemQuant_select( $max ){global $post, $usces;
if(empty($max)){$max = 10;}
$zaiko = usces_the_itemZaikoNum(‘return’);
$sku_enc = urlencode(usces_the_itemSku(‘return’));
$restriction = $usces->getItemRestriction($post->ID);
if( (” != $zaiko && 0 < $zaiko && ” != $restriction && $zaiko > $restriction) || (” == $zaiko && ” != $restriction) ){
$max = $restriction;}
elseif( ” != $zaiko && 0 < $zaiko && ” != $restriction && $zaiko < $restriction ){$max = $zaiko;}
$select = ‘<select name=”quant[‘ . $post->ID . ‘][‘ . $sku_enc . ‘]” id=”quant[‘ . $post->ID . ‘][‘ . $sku_enc . ‘]” class=”skuquantity” onkeydown=”if (event.keyCode == 13) {return false;}”>’ . “\n”;
for($i=1; $i<=$max; $i++){
$select .= ‘<option value=”‘ . $i . ‘”>’ . $i . ‘</option>’ . “\n”;}
$select .= ‘</select>’;
echo $select;}

【製作中のsingle.item.php】
<div class=”actionform”>
<form action=”<?php echo USCES_CART_URL; ?>” method=”post”>
<?php usces_the_itemGpExp(); ?>
<div class=”skuform”>
<?php if (usces_is_options()) : ?>
<table class=’skusingle’>
<?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’, __(‘Sold Out’,’usces’)); ?></div>
<?php else : ?>
<div class=”addtocart”>
<div style=”margin-top:10px”><?php _e(‘Quantity’, ‘usces’); ?><?php bks_the_itemQuant_select( 30 ); ?> <?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 wpfp_link() ?>
<?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>
</div>