After others' previous questions, I have a question here: Automatically create an user account after WooCommerce checkout and auto login
First question:
How in this section that the message (Thank you. Your order has been received. An account has been automatically created for you and you are now <a href="https://yoursite.name/my-account/">logged in< /a>.You will receive an email about this) displays, should I display the password that was created along with the email that was entered to the customer? (Also, if the customer enters other fields such as first and last name, phone number, etc., it will be displayed here.)
Second question:
When I use this code:
$link = get_permalink( get_option( 'woocommerce_myaccount_page_id' ) );
For me, it displays the value of the link as text, that is, it looks like this:
Thank you. Your order has been received. An account has been automatically created for you and you are now <a href="https://yoursite.name/my-account/">logged in</a>. You will receive an email about this.
How do I fix this problem? that the login value has a link href instead of being displayed as text
The main question is whether these codes are standard and up-to-date? Do they need to be modified or changed to improve performance?
First question: You never display any password, for security reasons, and an email is sent to the customer for this purpose. The customer doesn't enter anything else than the information on checkout fields, so all required information is already displayed in the order received page.
Second question:
woocommerce_thankyou_order_received_texthook is located in checkout/order-received.php template file as follows:As you can see the output is HTML escaped, so it's not possible for the moment to render any HTML. But this is a reported bug and will be solved in WooCommerce upcoming version 8.3
So replace the 2nd function with:
Related: Automatically create an user account after WooCommerce checkout and auto login