Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Woocommerce Review Order before Payment

I am trying to add a review order page on my Woocommerce web shop. Currently, When I add items to the cart, I can proceed to the checkout page where the billing and shipping addresses are required and submitted, then, the next step is the Payment page (with PayPal). I want to add an order review page before it goes to the Payment page, so after the addresses are entered on the checkout page and the user clicks proceed, an order summary/review page should be displayed with the Order totals, and addresses entered previously, and a link to go back if ten user wants to change an address. Like a confirmation page. Then, once the user proceeds, then it goes to the payment page.

I have researched this with no luck. I tried this action in the functions.php, but it doesn't work:

add_action( 'woocommerce_review_order_before_submit','woocommerce_order_details_table');

Is there a way to do this with woocommerce? There are no setting for this in the admin panel either.

like image 603
Tester Avatar asked Aug 14 '14 20:08

Tester


1 Answers

I recently came across this issue. My solution was to create a page called 'Review Order' in the back-end of Wordpress and enter the shortcode [woocommerce_checkout] in the content editor. I then create a 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 checkout process and get the information I needed without much hassle, but I could swap out what parts of the process could belong to the checkout page and what parts could belong to the review page with the following:

if (defined( 'THIS_IS_REVIEW'))
{
  $reviewPage = true;
}
like image 185
Adam Hollock Avatar answered Oct 15 '22 07:10

Adam Hollock