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: hidden link
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.