Skip Navigation

[Resuelto] YITH WooCommerce Request A Quote shortcode not working for logged-out users

Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.

Problem:
YITH WooCommerce Request A Quote shortcode - how to add pass post id to product attribute

Solution:

You can find the proposed solution in this case with the following reply:
https://toolset.com/forums/topic/yith-woocommerce-request-a-quote-shortcode-not-working-for-logged-out-users/#post-2077073

Relevant Documentation:

This support ticket is created hace 3 años, 6 meses. 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.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

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)

Este tema contiene 2 respuestas, tiene 2 mensajes.

Última actualización por Altti Papinsaari hace 3 años, 5 meses.

Asistido por: Minesh.

Autor
Mensajes
#2076901

Hello,

I am trying to: I have view displaying list of Woocommerce products. In the view I'm using YITH WooCommerce Request A Quote Premium plugin's shortcode [yith_ywraq_button_quote] to display Add to quote button. This works fine when user is logged in. But when user is logged out the button is not displayed.

I contacted YITH support about this issue and here is what they said:
”the problem is that when you are not logged
on your side there's no info about the product

I will try to make it as clear as possible

when you use this shortcode [yith_ywraq_button_quote]
the plugin check for woocommerce global $product var that is always present.
In your installation, while this is present when you are logged, this value is Null when you are not logged.
This is not a default behaviour so I suppose some plugin or theme is removing this information when the user is not logged. Maybe a plugin or theme option to fully disable the shop?!”

I also tested adding the shortcode outside the view with product parameter [yith_ywraq_button_quote product="1234"] and this time the shortcode worked for logged-out users too.

Also while writing this I tested adding YITH shortcode with the parameter inside the view and it seems to work OK. So this problem is kind of resolved.

Still the shortcode doesn't work without parameter for logged-out users but it does work for logged in users.

Link to a page where the issue can be seen: enlace oculto

#2077069

Minesh
Supporter

Idiomas: Inglés (English )

Zona horaria: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

If the issue is resolved with the following shortcode as workaround:

[yith_ywraq_button_quote product="1234"]

It will be a better solution I believe as we will have option to tell the shortcode what product actually you want to query as we pass the product ID and there will be less compatibility issue like we have currently that $product variable is overridden by them or any other plugin.

#2077073

Thanks you reply Minesh,

just in case someone else has the same problem, I also used View's post id shortcode inside the YITH's shortcode like this:

[yith_ywraq_button_quote product="[wpv-post-id]"]