Skip Navigation

[Resolved] Adding Woocommerce Products to a Custom Post Type Template

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

Problem:

How do I display the variable products on the custom post type template and display the variations with images and not a dropdown select?

Solution:

There isn't such kind of built-in feature within Toolset Woocomerce Blocks plugin, see our document:

[wpv-woo-buy-or-select]

For variable products the Select options button will be displayed.

Relevant Documentation:

https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#vf-154336

This support ticket is created 3 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

This topic contains 4 replies, has 2 voices.

Last updated by davidJ-4 3 years, 7 months ago.

Assisted by: Luo Yang.

Author
Posts
#2084165

I am working on a website that sell sim cards with phone plans of every country in the world in additions to renting phones and wifi hotpost for people that travels.

I have created a custom post types "Destinations" and made it have a relation with Woocommerce products. In this custom post type, the template would contain the following content:
- Country Name as the title
- Description
- Woocommerce variable products that are in relation with the post (about 3 products) with options display with images and not dropdown
- tabs with extra information.

1. How do I display the variable products on the custom post type template and display the variations with images and not a dropdown select?

2. For the tabs, I would like to create a repeatable group field called "Extra Info" and have it display/generate automatically a tab on the front-end. Is this possible to create? The repeatable group would 2 fields: one for the title of the tab and one for the content of the tab

I would appreciate any guidance on this projects.

Thanks

#2084375

Hello,

Q1) How do I display the variable products on the custom post type template and display the variations with images and not a dropdown select?
There isn't such kind of built-in feature within Toolset Woocomerce Blocks plugin, see our document:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#vf-154336

[wpv-woo-buy-or-select]
...
For variable products the Select options button will be displayed.

Q2) For the tabs...
There isn't such kind of built-in feature too, it needs to output the view's loop as Tabs, you might consider custom JS/CSS codes, for example:
Jquery UI Tabs
hidden link

#2088209

Thank you for your answer.

1. I will check the link you send for the products display.

2. So I need to create a new custom post type "Extra info" (instead of repeatable group field) and make it have a relation to the custom post type "destinations" therefore I could use Views to generate Tabs. Am I understanding this correctly?

#2089087

I think there are some misunderstandings:
1) Toolset repeatable field groups is based on one-to-many relationship, so you can get the same result with repeatable field groups or child post types.
2) The problem is Toolset Blocks/Views plugins can not output the results in "Tabs" layout mode by default, in order to achieve the "Tabs" feature, it needs custom JS/CSS codes, see the example I mentioned above:
hidden link

#2095187

I found a solution on my own for the first question. For the second question, I will try your suggestions for the tabs and will come back with a new ticket if I need more help.

Thank you for your help.