Skip Navigation

[Résolu] access of relationship cpt

This support ticket is created Il y a 3 années et 1 mois. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Marqué : 

This topic contains 7 réponses, has 2 voix.

Last updated by Ido Angel Il y a 3 années et 1 mois.

Assigned support staff: Nigel.

Auteur
Publications
#1410041
guests.png
allowed-users.png

Hey,
My woocommerce products have relationship with a cpt called "sarig-products".
I restrict access per role to each product - only users with role "partner" can see the product called "partner", and so forth.
I made a layout for non-logged users (guests) with a login form, which is redirecting them after login to the product they are matched for (using the plugin "peter's login redirect).
But - when guests go to the product, instead of getting the login form once, they get the login form 5 times: the product + the 5 "sarig products" related to it. But I haven't restricted the "sarig products" cpt. By the way - I also get to see a text paragraph I entered in the single-product template made in elementor.
If I change "What to display for single-posts when there is no read permission" from the layout to the default error, I get the error fine, e.g just once.
This looks like a bug. Is there any way around this?
thanks!

#1410349

So - I understood there's stil a compatibility issue with access and elementor.... so I converted to blocks! works 🙂

#1410423

Ok - maybe someone DOES have a solution? Because I'm using a one page checkout plugin which doesn't work when I am using the woocommerce views template....
So , maybe we can either:
1) find a solution to the access/elementor problem
2) find how to make the plugin work when I'm on the woocommerce views template...
thanks!

#1411235

Nigel
Supporter

Languages: Anglais (English ) Espagnol (Español )

Timezone: Europe/London (GMT+00:00)

Hi Ido

It is not recommended to use Layouts and another page builder such as Elementor, you should choose one and stick with it.

So if you intend to use Elementor, I suggest you don't use Layouts.

You should be able to insert a log-in form into an Elementor template by adding the shortcode to an Elementor text module.

https://toolset.com/documentation/user-guides/views/views-shortcodes/#wpv-login-form

Do you want to reconfigure that and then see if you still have the original problem?

I can then get more details of that and see how to proceed.

#1411247

Hey Nigel!
I can add the shortcode, no problem - the issue is that I can't use access with this page.
I login form to show only for guests, and the product to show only for logged in users. But when I put the product in a "post group" in access, It doesn't work (see images).
thx,
Ido

#1411791

Nigel
Supporter

Languages: Anglais (English ) Espagnol (Español )

Timezone: Europe/London (GMT+00:00)

If you are using wpv-login-form to insert the log-in form, it should only appear to guests, not logged-in users.

I'll need to take a look at your site to see if I can understand what is going on, I'm having problems understanding your description.

I'll get back to you later.

#1411859

Ok - I think I got the problem.
Let me try to explain:

I have a product. It's created with an Elementor Single-Product template.
I want to restrict access to this product, so I created a post group in "Access" and added the product to it. For not logged-in users (guests) I created a layout with a login form. And things go wrong.

From what you're saying, I gather that the issue is the error message I chose for the post group. If I choose the regular error message, things work OK. But If i redirect to a layout, then - like you said - it mixes layouts with elementor and that's wrong.
I'll try creating a 404 page with elementor which will hopefully act as the "default error", then I might be able to avoid the layout use and let's see if that works.

Thanks!

Ido

#1411863

Worked!!