E
E
Elizaveta Cezurk2020-12-10 15:42:05
WordPress
Elizaveta Cezurk, 2020-12-10 15:42:05

How to send a link to a woocomerce order information to a customer?

Hello, I have a question for you, I don’t know how to ask it correctly to Google, it doesn’t give the results that I would like)
In my store, after placing an order, it was transferred to the details of the order, what was ordered, details and so on ...
I want to send an email with a link to this information after the order, how can I do this?
Now I have done that after placing an order, the user is sent to the "thank you" page.
Here. Somehow, I hope you understand me, all the best! :)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Fink, 2020-12-10
@semechki

This way you can add a link to the page with information about the order in the letter to the client. To view this page, the customer must be logged in to the store's website.

add_action( 'woocommerce_email_before_order_table', 'fink_link_to_order', 25, 4);
function fink_link_to_order( $order, $sent_to_admin, $plain_text, $email ) {
    if( false === $sent_to_admin ) {

        echo '<a href="' . $order->get_view_order_url() . '">Ваш заказ №'. $order->get_order_number() .' на сайте</a>';

    }

}

5fd22852adb19806988450.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question