下面是我的代码片段
   <?php echo apply_filters( \'woocommerce_order_button_html\', \'<input type="submit" class="button alt" name="woocommerce_checkout_place_order" id="place_order" value="\' . esc_attr( $order_button_text ) . \'" data-value="\' . esc_attr( $order_button_text ) . \'" />\' ); ?>
       <?php if ( wc_get_page_id( \'terms\' ) > 0 && apply_filters( \'woocommerce_checkout_show_terms\', true ) ) : ?>
                <p class="form-row terms">
                    <label for="terms" class="checkbox"><?php printf( __( \'I’ve read and accept the <a href="%s" target="_blank">terms & conditions</a>\', \'yit\' ), esc_url( get_permalink( wc_get_page_id( \'terms\' ) ) ) ); ?></label>
                    <input type="checkbox" class="input-checkbox" name="terms" <?php checked( apply_filters( \'woocommerce_terms_is_checked_default\', isset( $_POST[\'terms\'] ) ), true ); ?> id="terms" />
                </p>
                <p class="subscribe">
                Subscribe to get discounts, coupons and tips
                <?php include "/home/edcthings/public_html/wp-content/plugins/yith-essential-kit-for-woocommerce-1/modules/yith-woocommerce-mailchimp/templates/mailchimp-subscription-checkbox.php" ?>
                </p>
            <?php endif; ?>
            <?php do_action( \'woocommerce_review_order_after_submit\' ); ?>
        </div>
        <div class="clear"></div>
 我需要禁用提交按钮,但仍允许它进行处理。我找到了可以使用此表单的javascript,但它没有。
$(function(){
 $(".button").click(function () {
   $(".button").attr("disabled", true);
   $(\'#cart-table\').submit();
 });
 });
 接收控制台错误“Uncaught TypeError:$不是函数”
编辑:我找到了错误发生的原因。我在WordPress中将代码更改为功能正确。。。
    <script type="text/javascript" charset="utf-8">
    jQuery(document).ready(function($){
      $(".button").click(function () {
      $(".button").attr("disabled", true);
      $(\'#checkout\').submit();
      });
    });
    </script>
 这会禁用按钮,但仍不允许表单提交