Woocommerce pre-order before payment

I am trying to add a review page to my Woocommerce web store. Currently, when I add items to the cart, I can go to the checkout page where billing and delivery addresses are required and sent, and then the next step is the "Payment" page (with PayPal). I want to add an order verification page before it goes to the "Payment" page, therefore, after the addresses are entered on the verification page and clicked on by the user, a page with a description and overview of orders should be displayed with the results of the order, and the addresses entered earlier , and a link to return if ten users want to change the address. Like a confirmation page. Then, as soon as the user continues to work, he will go to the payment page.

I researched this with no luck. I tried this action in functions.php , but it does not work:

 add_action( 'woocommerce_review_order_before_submit','woocommerce_order_details_table'); 

Is there a way to do this using woocommerce? There are also no settings for the control panel.

+5
source share
2 answers

I recently ran into this problem. My solution was to create a page called “Order Feedback” at the end of Wordpress and enter the short code [woocommerce_checkout] in the content editor. Then I create the page-review-order.php in the root of my child theme.

In my page-review-order.php, I set the following definitions:

 if ( ! defined( 'THIS_IS_CHECKOUT' ) ) { define( 'THIS_IS_CHECKOUT', true ); } if ( ! defined( 'THIS_IS_REVIEW') ) { define( 'THIS_IS_REVIEW', true); } 

From here I was able to go through the typical ordering process and get the necessary information without much hassle, but I could change which parts of the process may belong to the verification page and which parts may belong to the review page with the following:

 if (defined( 'THIS_IS_REVIEW')) { $reviewPage = true; } 
+1
source

Looking at the WooCommerce setting that I manage, I see that you can set the Cart page in the admin via WooCommerce> Settings> Checkout (tab at the top).

Scroll down the page to “Checkout Page” and make sure “Cart Page” is selected. If you are not creating a page called, for example, "Shopping Cart", and add the following short code to it: [woocommerce_cart]

Once you do this, go back to the previous WooCommerce settings page and select the new page that you created.

This page is placed in front of the payment details during the checkout process.

Let me know if this helps.

0
source

Source: https://habr.com/ru/post/1200358/


All Articles