Skip Navigation

[Resolved] Is there a shortcode to the single product page from the main shop?

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

Problem:
On a WooCommerce shop page client wants to replace the add-to-cart button with a link to the individual product page.

Solution:
Remove the add-to-cart button from the template and replace it with a simple link you manually insert where the href is set from the url of the current post in the Loop:

<a href="[wpv-post-url]">View</a>

Relevant Documentation:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-url

This support ticket is created 6 years, 7 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
- 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)

This topic contains 2 replies, has 2 voices.

Last updated by gwendolynG 6 years, 6 months ago.

Assisted by: Nigel.

Author
Posts
#912120

Tell us what you are trying to do?

I've created a layout on hidden link and that's exactly what we wanted right now. However, the "view" button needs to take the user to the single product page, not add to cart.

Is there any documentation that you are following?

I've looked at shortcodes and see no references.

Is there a similar example that we can see?

Looking for default WooCommerce single-product.php action on the shop button and not the add-to-cart.

What is the link to your site?

We're in staging at "hidden link"

#912181

Nigel
Supporter

Languages: English (English ) Spanish (Español )

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

Hi Gwendolyn

I guess you are generating the button using the wpv-woo-buy-or-select shortcode inside a custom archive listing products.

To link to the individual product page you can simply create your own button, something like

<a href="[wpv-post-url]">View</a>

https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-url

#914976

That's exactly the solution that was needed, thank you. I didn't see it in the docs anywhere, just a reference to the add-to-cart button.