Skip Navigation

[Resolved] How to connect the "WC Subscription – My account" to a "Create New Post Form"

This support ticket is created 3 years, 1 month 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 7 replies, has 2 voices.

Last updated by ilonaB-2 3 years, 1 month ago.

Assisted by: Minesh.

Author
Posts
#2202731
Reply #2202343 by Luo Yang.png

Hi Toolset Support Team,

Can anyone please respond to this message since Luo Yang won't be online untill Monday.

Thanks for the reply - see attached image!
I do have 1 question regarding the comment (see attached image): "If there isn't any result found, display the post form for creating new profile post
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-no-items-found".

What is the exact code for that and how do i need to input that in the Loop Template?

Also at the moment when I go to the "My-account" page ( as a visitor - not logged-in ), right no I see the the "No Items Found" text displayed. So when i put in the code i need (1st question), I guess non logged-in visitors can see that as well. How do I prevent that??

Thanks in advance for the support

#2202773

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Do you mean that you want to display the form when user is not-logged in?

If you can share more details with problem URL and access details I would be happy to help.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2202821

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please confirm what form you want to display when user is not logged in?

#2202883
Image 2.png
Image 1.png

Hi Minesh,

When the user is not logged-in it shouldn't display any form.

Just the login page, see: image 1

When a user is logged in, he sees his own profile, see: image 2

But when a user is new and has done these steps:
1. At the homepage clicked on the button "Registreren ondernemers",
2. Selected a product (1 year subscription - monthly payment),
3. Directed to checkout page,
4. Filled in payment details,
5. Paid for the subscription,
6. Received the confirmation mail with log-in details,
7. Logged-in to his "My Account" page.

He hasn't created a Profile post yet and needs to see the link, for the form to create a new profile (Post Form - Profiel aanmaken formulier ID: 4449).

This Form should only be visible to new users who haven't yet created a profile.

Once created this link needs to be replaced bij the one shown in image 2 (Since each user is only allowed to create one post).

I hope you understand what i'm describing...

#2202961

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

What I'm asking is what form you created using Toolset that you would like to display for non loggedin users?

Can you please share link of that form?

#2203157

Hi Minesh,

I think we have a misunderstanding.
There is no form for non logged-in users (nothing except hidden link), since he can't access the my account page. (no Member yet. For that he needs to go to the "registreren ondernemers" page).

What we do want for everyone to see who isn't logged-in that clicks on the "Mijn Account" (My account) button is the Log-in page(set-up by WC Subscriptions).

But let's get back to the original question, when a user (new or excisting) IS logged in:
- How do i only show NEW users the "Create new post" (ID: 4449) link or form (like mentioned before, new users are only allowed to create 1 new post)?
and
- How do i only show the RETURNING user (who already created a post) the view loop that i created for logged-in users see previous "image 2" (this is the actual profile form with an "Edit"link in the left top corner)??

Thanks in advance

#2204687

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Ok - Can you please tell me what content template you created for "My Account" page?

- How do i only show NEW users the "Create new post" (ID: 4449) link or form (like mentioned before, new users are only allowed to create 1 new post)?
==>
When uesr is logged-in, he/she will be redirected to "My Account" page and on my account page, we will display the view that lists the posts created by current loggedin user.

Have you followed the following Doc?
=> https://toolset.com/course-lesson/creating-a-my-account-page/

#2204723

Hi Minesh,

I resolved it myself using the following:

In the WooCommerce Subscription “My Account” page, I’ve added 2 containers with the following:

1st Container:
- Added a view
- Content selection -> query filter -> author same as current logged-in user
- View Loop
- Conditional -> NOT (current user role is equal to role subscriber)
- Inside I added the content template with user profile

2nd container:
- Added a view
- Content selection -> query filter -> author same as current logged-in user
- View loop
- Loop template -> [cred_form form="create-new-post-form"]

My issue is resolved now. Thank you!