Skip Navigation

[Resolved] Adding shipping address to notification

This thread is resolved. Here is a description of the problem and solution.

Problem:

I would like to include the shipping address used in woocommerce in this notification so that the production team has everything they need to create and ship the product in a single email.

Solution:

After user submit the Toolset form and place the order, this order post will be marked as "Processing" status, current user is still the customer who placed the order.

And Woocommerce plugin is using custom user fields to store the shipping address information:

- shipping_address_1

- shipping_address_2

So you can use Views shortcode [wpv-user] to display current user's information in the Email body, for example:

shipping_address_1:
[wpv-user field="shipping_address_1"]
shipping_address_2:
[wpv-user field="shipping_address_2"]

Relevant Documentation:

https://wp-types.com/documentation/user-guides/views-shortcodes/#wpv-user

This support ticket is created 5 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 6 replies, has 2 voices.

Last updated by scottL-5 5 years, 11 months ago.

Assisted by: Luo Yang.

Author
Posts
#1193275

Tell us what you are trying to do?

I have a membership site. Curently there is a notification that happens after a user submits a form and their purchase status changes to Processing that goes to a member of our production staff to create their product.

I would like to include the shipping address used in woocommerce in this notification so that the production team has everything they need to create and ship the product in a single email.

Is there any documentation that you are following?

No

Is there a similar example that we can see?

What is the link to your site?

sharemystory.online

#1193499

Hello,

After user submit the Toolset form and place the order, this order post will be marked as "Processing" status, current user is still the customer who placed the order.

And Woocommerce plugin is using custom user fields to store the shipping address information:
- shipping_address_1
- shipping_address_2

So you can use Views shortcode [wpv-user] to display current user's information in the Email body, for example:

shipping_address_1:
[wpv-user field="shipping_address_1"]
shipping_address_2:
[wpv-user field="shipping_address_2"]

More help:
hidden link

Display user info. If the shortcode is inside a Views user query, it will display information for the user found in loop. Otherwise it will display information for the current logged-in user or the user with the specific id, when id attribute is set.

#1193985

Thanks for the help. Certainly much closer.

So my email is part of a notification for a post form. So when I added [wpv-user field="shipping_address_1"]

What I got back was my username in the test email.

Which seemed an unusual output.

How can I format this to spit out the shipping address from the current user?
thanks

#1194084

This is abnormal, please check these:
1) Dashboard-> Users, Edit the specific user's profile, make sure you have setup values in the user fields:
- shipping_address_1
- shipping_address_2

2) In case it is a compatibility problem, please deactivate other plugins, and switch to wordpress default theme 2019, and test again

3) If the problem still persists, please provide database dump file(ZIP file) of your website, also point out the problem page URL and form URL, I need to test and debug it in my localhost, thanks
https://toolset.com/faq/provide-supporters-copy-site/

#1200114

How can I send this information privately

#1200303
billing-address.jpg

I can get the duplicator link from the email, it seems you have edited the contents, so you don't need to send the information privately.

Please check your website, login as an administrator:
Dashboard-> Users, edit any customer user, for example "scott"
Edit user "scott", you should be able to see those custom user fields are empty:
- shipping_address_1
- shipping_address_2

But as you can see the other two custom fields do have values:
- billing_address_1
- billing_address_1

So you can try these:
1) Edit the post form "Stories Post form"
in the email notification settings, replace the shortcodes with:
[wpv-user field="billing_address_1"]
[wpv-user field="billing_address_2"]

2) Login as user "scott", submit form "Stories Post form" and test again, it works fine in my localhost, see screenshot:
billing-address.jpg

And if it is a guest user(non-logged-in user), they have not provided the address values when submit the form, so above shortcodes will output empty value.

#1200317

My issue is resolved now. Thank you!