shortcode_wrapper('woocommerce_thankyou', $atts); } /** * Outputs the order received page **/ function woocommerce_thankyou( $atts ) { global $woocommerce; // Pay for order after checkout step if (isset($_GET['order'])) $order_id = $_GET['order']; else $order_id = 0; if (isset($_GET['key'])) $order_key = $_GET['key']; else $order_key = ''; // Empty awaiting payment session unset($_SESSION['order_awaiting_payment']); if ($order_id > 0) : $order = &new woocommerce_order( $order_id ); if ($order->order_key == $order_key) : if (in_array($order->status, array('failed'))) : echo '

' . __('Unfortunately your order cannot be processed as the originating bank/merchant has declined your transaction.', 'woothemes') . '

'; echo '

'; _e('Please attempt your purchase again', 'woothemes'); if (is_user_logged_in()) : _e(' or go to your account page', 'woothemes'); endif; echo '.

'; echo ''.__('Pay', 'woothemes').' '; if (is_user_logged_in()) : echo ''.__('My Account', 'woothemes').''; endif; else : echo '

' . __('Thank you. Your order has been received.', 'woothemes') . '

'; ?>
payment_method, $order_id ); endif; else : echo '

' . __('Thank you. Your order has been received.', 'woothemes') . '

'; endif; }