WooCommerce:将表单元素添加到variable.php中断了数量功能

时间:2016-01-06 15:40:21

标签: woocommerce

我在single-product/add-to-cart/variable.php的形式中添加了两个额外的表单元素(单选按钮)。现在数量字段不起作用:如果我选择" 5"例如,单击Add-to-Cart按钮并访问我的购物车,只添加了1项而不是5.如果我删除了我的额外元素,它会再次运行。对于发生了什么事的任何建议?

我在do_action( 'woocommerce_after_single_variation' );之后添加了表单元素:

<?php do_action( 'woocommerce_after_single_variation' ); ?>

<div class="auto_replenish_wrap">
    <div class="auto_replenish_option">
        <input type="radio" name="auto_replenish" value="auto_replenish_no" checked="checked">
        <label for="auto_replenish_no">
            Deliver one-time only
        </label>
    </div>
    <div class="auto_replenish_option">
        <input type="radio" name="auto_replenish" value="auto_replenish_yes">
        <label for="auto_replenish_yes">
            <div class="auto_replenish_yes_label">
                Auto-replenish <a href='#'>(See details)</a>
            </div>
            <div class="auto_replenish_yes_label_frequency">
                <span class="delivery_frequency">
                    Deliver every
                    <input type="button" class="minus" value="-">
                    <input type="text" size="4" class="input-text qty text" title="Qty" value="1" name="quantity" step="1" pattern="[0-9]*" id="delivery_frequency_value" min="1">
                    <input type="button" class="plus" value="+">
                    month(s)
                </span>
            </div>
        </label>
    </div>          
</div>
<div class="add_to_cart_and_learn_more">
    <a class="learn_more_after_add_to_cart_button" href="<?php the_permalink(); ?>">Learn More</a>
</div>

0 个答案:

没有答案