-
Author
-
September 7, 2015 at 15:12 #76445lindorfilmsParticipant
Can you please help me on that. I am trying to setup custom thank you page with this tutorial:
http://nicolamustone.it/2015/01/21/customize-the-thank-you-page-in-woocommerce/But when i add the code, my website and the backend show blank pages.
Is there any way i can do this?
Thank you
September 8, 2015 at 18:59 #76615RaduModeratorHi,
Sorry to say but it takes to much time to test, debug and implement this, try to enable wp debug https://codex.wordpress.org/WP_DEBUG#Usage and see what error it shows.
Cheers
Radu
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionSeptember 9, 2015 at 20:53 #76809lindorfilmsParticipantThanks for your reply. I activate debug. I got no warnings. just a blank page.
September 10, 2015 at 18:16 #77059RaduModeratorHi,
I think you receive the blank page because of this function :
COPY CODEadd_filter( 'the_content', 'wc_custom_thankyou' ); function wc_custom_thankyou( $content ) { // Check if is the correct page if ( ! is_page(3) ) { return $content; } // check if the order ID exists if ( ! isset( $_GET['order'] ) ) { return $content; } // intval() ensures that we use an integer value for the order ID $order = wc_get_order( intval( $_GET['order'] ) ); ob_start(); // Check that the order is valid if ( ! $order ) { // The order can't be returned by WooCommerce - Just say thank you ?><p><?php echo apply_filters( 'woocommerce_thankyou_order_received_text', __( 'Thank you. Your order has been received.', 'woocommerce' ), null ); ?></p><?php } else { if ( $order->has_status( 'failed' ) ) { // Order failed - Print error messages and ask to pay again /** * @hooked wc_custom_thankyou_failed - 10 */ do_action( 'wc_custom_thankyou_failed', $order ); } else { // The order is successfull - print the complete order review /** * @hooked wc_custom_thankyou_header - 10 * @hooked wc_custom_thankyou_table - 20 * @hooked wc_custom_thankyou_customer_details - 30 */ do_action( 'wc_custom_thankyou_successful', $order ); } } $content .= ob_get_contents(); ob_end_clean(); return $content; }
Replace the existing function from functions.php with the function above, also replace id 3 with your thank you id page.
COPY CODE// Check if is the correct page if ( ! is_page(3) ) {
Cheers
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution -
AuthorPosts
The forum ‘KLEO’ is closed to new topics and replies.