mercredi 18 juillet 2018

Payment method is not required for selection Woocommerce 3

The payment method is not required for selection. That is, change "select" to "checkbox" on checkout page. And the order can be made even if the payment method is not selected.

I suspect that this is not enough, since it is possible, it will cause an error or a problem if you do not choose a payment method.

Therefore, I want to add the ability to create an order without choosing payment methods. And, accordingly, the system should understand that for the order it is necessary to assign a status, for example "On Hold".

wp-content\plugins\woocommerce\templates\checkout\payment-method.php

<li class="wc_payment_method payment_method_<?php echo $gateway->id; ?>">
    <input id="payment_method_<?php echo $gateway->id; ?>" type="radio" class="input-radio" name="payment_method" value="<?php echo esc_attr( $gateway->id ); ?>" <?php checked( $gateway->chosen, true ); ?> data-order_button_text="<?php echo esc_attr( $gateway->order_button_text ); ?>" />

    <label for="payment_method_<?php echo $gateway->id; ?>">
        <?php echo $gateway->get_title(); ?> <?php echo $gateway->get_icon(); ?>
    </label>
    <?php if ( $gateway->has_fields() || $gateway->get_description() ) : ?>
        <div class="payment_box payment_method_<?php echo $gateway->id; ?>" <?php if ( ! $gateway->chosen ) : ?>style="display:none;"<?php endif; ?>>
            <?php $gateway->payment_fields(); ?>
        </div>
    <?php endif; ?>
</li>




Aucun commentaire:

Enregistrer un commentaire