Answer the question
In order to leave comments, you need to log in
How to add a page with validation of the entered data between the cart and payment in the woocommerce store?
Hello!
There is a woocommerce store .
I want to make a functional in which to combine the pages of the cart cart and checkout ckechout (product + address fields + choice of payment method), so that the buyer spends minimal effort to pay for the goods.
And then he got to the intermediate order confirmation page according to the principle as implemented in this WooCommerce Review Order plugin
.
I work according to the visual guide
To implement this task, I transferred the client address fields from the checkout page to the cart like this
<form name="checkout" method="post" class="checkout woocommerce-checkout" action="<?php echo esc_url( wc_get_checkout_url() ); ?>" enctype="multipart/form-data">
<?php $fields = WC()->checkout()->get_checkout_fields( 'billing' );
foreach ( $fields as $key => $field ) {
woocommerce_form_field( $key, $field, $checkout->get_value( $key ) );
}
$fields = WC()->checkout()->get_checkout_fields( 'shipping' );
foreach ( $fields as $key => $field ) {
woocommerce_form_field( $key, $field, $checkout->get_value( $key ) );
} ?>
</form>
<div id="order_review" class="woocommerce-checkout-review-order">
<?php do_action( 'woocommerce_checkout_order_review' ); ?>
</div>
remove_action( 'woocommerce_checkout_order_review', 'woocommerce_checkout_payment', 20 );
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question