Mi tema wp fue creado a la medida y tiene una excelente experiencia de pago con ajax, pero tengo un problema cuando los clientes intentan pagar con una tarjeta de regalo que cubre el monto total del carrito. Esencialmente, durante todo el proceso de pago, hay un solo botón para continuar con los pasos de pago; Envío>facturación>resumen.
Cuando se aplica una tarjeta de regalo que cubre el monto total, los clientes ingresan su información de envío, luego hacen clic en Siguiente para ir a la facturación, en este punto los campos de la tarjeta de crédito están ocultos (como deberían estar), pero el botón (que ahora dice Ya no se puede hacer clic en «Continuar con el resumen»). El cliente no puede moverse de la página de facturación vacía para completar su pedido. Como tal, ¿hay alguna manera de omitir el paso de «facturación» si el total del pedido es 0 e ir directamente al resumen para que el cliente pueda completar su pedido?
Aquí está el código de mi tema form-checkout.php:
<?php
/**
* Checkout Form
*
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-checkout.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://docs.woocommerce.com/document/template-structure/
* @package WooCommerce/Templates
* @version 3.5.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
do_action( 'woocommerce_before_checkout_form', $checkout );
// If checkout registration is disabled and not logged in, the user cannot checkout.
if ( ! $checkout->is_registration_enabled() && $checkout->is_registration_required() && ! is_user_logged_in() ) {
echo esc_html( apply_filters( 'woocommerce_checkout_must_be_logged_in_message', __( 'You must be logged in to checkout.', 'woocommerce' ) ) );
return;
}
?>
<div class="checkout-container d-lg-flex">
<!-- Checkout main -->
<div class="checkout-main">
<!-- Header -->
<div class="checkout-header"><?php _e('Secure checkout', 'woocommerce'); ?></div>
<?php if( !is_user_logged_in() ){ ?>
<div class="checkout-section section-checkout-logreg">
<?php
if( isset($_GET['action']) && $_GET['action'] == 'register' ) {
//wc_get_template( '/checkout/checkout_registration_page.php' );
wc_get_template( 'myaccount/form-registration.php' );
}
else if( isset($_GET['action']) && $_GET['action'] == 'forgot_pass' ) {
//wc_get_template( '/checkout/checkout_registration_page.php' );
wc_get_template( 'myaccount/form-lost-password.php' );
}
else{
//wc_get_template( '/checkout/checkout_login_page.php' );
wc_get_template( 'myaccount/form-login-single.php' );
}
?>
<!-- Button area -->
<div class="checkout-button-area d-flex flex-wrap justify-content-between">
<a href="https://stackoverflow.com/questions/59241358/<?php echo get_permalink( woocommerce_get_page_id("shop' ) ); ?>" class="checkout-button-prev button button-lg button-secondary-light w-190p"><?php _e('Back To store', 'woocommerce'); ?></a>
</div>
</div>
<?php } ?>
<!-- Progress -->
<div class="checkout-progress"<?php if(!is_user_logged_in()){ echo ' style="display: none;"'; } ?>>
<div class="progress-step active" id="progress-shipping">
<?php _e('Shipping', 'woocommerce'); ?>
</div>
<div class="progress-step" id="progress-payment">
<?php _e('Payment', 'woocommerce'); ?>
</div>
<div class="progress-step" id="progress-summary">
<?php _e('Summary', 'woocommerce'); ?>
</div>
</div>
<form name="checkout" method="post" class="checkout woocommerce-checkout" action="<?php echo esc_url( wc_get_checkout_url() ); ?>" enctype="multipart/form-data"<?php if(!is_user_logged_in()){ echo ' style="display: none;"'; } ?>>
<?php if ( $checkout->get_checkout_fields() ) : ?>
<?php do_action( 'woocommerce_checkout_before_customer_details' ); ?>
<div id="customer_details">
<!-- Checkout Shipping -->
<div class="checkout-section section-shipping">
<?php do_action( 'woocommerce_checkout_shipping' ); ?>
</div>
<!-- Checkout Billing -->
<div class="checkout-section section-billing" style="display: none;">
<?php do_action( 'woocommerce_checkout_billing' ); ?>
</div>
<!-- Checkout Summary -->
<div class="checkout-section section-summary" style="display: none;">
<div class="row">
<div class="summary-section summary-shipping col-12 col-sm-6">
<div class="summary-section-wrap">
<h4 class="summary-title"><?php _e('Shipping Address', 'woocommerce'); ?></h4>
<button type="button" class="summary-edit" title="<?php _e('Edit', 'woocommerce'); ?>"><?php _e('Edit', 'woocommerce'); ?></button>
<div class="summary-section-content"></div>
</div>
</div>
<div class="summary-section summary-option col-12 col-sm-6">
<div class="summary-section-wrap">
<h4 class="summary-title"><?php _e('Shipping Option', 'woocommerce'); ?></h4>
<button type="button" class="summary-edit" title="<?php _e('Edit', 'woocommerce'); ?>"><?php _e('Edit', 'woocommerce'); ?></button>
<div class="summary-section-content"></div>
</div>
</div>
<div class="summary-section summary-payment col-12 col-sm-6" data-ending="<?php _e('Ending in', 'woocommerce'); ?>">
<div class="summary-section-wrap">
<h4 class="summary-title"><?php _e('Payment Details', 'woocommerce'); ?></h4>
<button type="button" class="summary-edit" title="<?php _e('Edit', 'woocommerce'); ?>"><?php _e('Edit', 'woocommerce'); ?></button>
<div class="summary-section-content"></div>
</div>
</div>
</div>
.