Skip Navigation

[Resolved] Showing wrong post type data with related product

This support ticket is created 7 years, 2 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 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 6 replies, has 2 voices.

Last updated by Shane 7 years, 2 months ago.

Assisted by: Shane.

Author
Posts
#571428
view-cd-and-book-fields.JPG
related-to-cd-posttype.JPG
cd-posttype-relationships.JPG
book-posttype-relationship.JPG

I am trying to:
Display information about some products, from custom post types, where the same "thing" is also represented.

As usual I made a mess

I have two post types, "cd" and "books", because we need to present these as just publications, meaning not just in the shop.
So, we have these publications, but they are related, like a cd+book is related, like a set, but is presented both separately and as a set.

E.g.
Product: "CD Product1"
"CD Product1" is related to "cd1"
And "cd1" is related to "book1"

SEE THE 2 IMAGES POSTTYPE-RELATIONSHIPS
"book" is parent to "product" and "cd"
"cd" is parent to product (and child of "book")

When I see "CD product1" in the shop, I have tried to create a view, displaying data from the custom post type "cd", this should be data from "cd1" because I selected it to be related to the product.
(Data like design, writer, publisher, video, sound, links etc.)

But the relationships gets messed up, and I don't know if I even should have used all these post types. Maybe products should have custom fields instead.

When I look at "CD Product1" it shows me information about the book. This product isn't even set to be related to the book post type, only to the cd.
(But the product is related to the cd and the cd is related to the book)

Link to a page where the issue can be seen:
This shows the data from the CPT in the right sidebar: hidden link
But as you can see in the first line, where I output the post type, it shows data from "bog"(Book), but the product is a cd.

I expected to see:
The same, but data from the cd post type.

Thanks for your time,
Best regards
Lykke

#571461

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Lykke,

Thank you for contacting our support forum.

I understand the concern here however their might be an easier way to do this if I understand what you are trying to achieve.

Could you explain in a bit of detail for me 🙂

Thanks,
Shane

#571922

Hi Shane,

I am not sure how to explain the "goal" differently or clearer. But I'll try.

The site is owned by a person who has published CD's and Books

These must be presented as "publications", seperately and together.
Meaning, "CD1" and "BOOK1" is also the set "CD1+BOOK1"

1. Publications
We want to display every CD/BOOK/CD+BOOK in pages (like post type pages)(presenting them together on the same page eI guess would just be a view)

2. Webshop
Besides showing pages with these publications.. we also want to sell them in a webshop.

So in the webshop we have (amongst others) the product categories "CD" and "BOOKS".

We create each "book" and "CD" (again) as products in these categories.

..and try (if it didn't create error messages) to use a woocommerce grouping plugin to sell CD+BOOK products as sets.

This is basically all

Publications + products (includes publications)

Thanks for your time
Best regards
Lykke

#571935

I forgot something important, in addition to the message above.

The CD and BOOKS have different post fields, e.g. the CD's has sound files and books have video files.
I need to display data like this in the product sidebar.

E.g. showing product "CD1", then in the sidebar, I want to show the soundfiles and other custom field data related to "CD1"

Same goes for every CD or BOOK product, I have a lot of custom fields, these data must show WITH the product.

Think of it like you're viewing a product, and at the same time presented more details about the specific publication.

Thanks again
Lykke

#572221

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Lykke,

Thank you for the clarity.

Actually I believe all this that you want to do can be achieved using the woocommerce plugin only.

What you can do is to create a CD1 and Book1 product and then you can also create a bundle or group product where the items are purchased together.

Take a look at the link below.
https://docs.woocommerce.com/document/group-bundle-products-woocommerce/

Please let me know if this helps.
Thanks,
Shane

#573010

Hi Shane:)

Thanks for your reply, I am missing some answers, so I hope we can keep the thread going here during my holiday.

We have the grouping plugin, though it's causing some error with toolset.

BUT

I don't understand how using just woocommerce, I can add the custom data to each cd or book..

- How do I add all the sound,video and other details? (The field sets, that I have currently attached to the custom page types)

In case the answer is easy..

Please also let me know how I do these things:

1. Display this data on a separate page about the publication..

and

2. How I make the product page more detailed, to display this custom data on the product page?
and in the sidebar as well?

Thank you for your time
Best regards
Lykke

#573340

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Lykke,

Woocommerce actually handles digital downloads quite well and its definitely worth looking into.

Take a look here.
https://docs.woocommerce.com/document/digital-downloadable-product-handling/

To make the product page more detailed we actually have a plugin that can help with this and its called our woocommerce views plug. Along with our views plugin it will allow you to fully customize your woocommerce product page.

Take a look at the document we have below.
https://toolset.com/learn/create-an-ecommerce-wordpress-site/

This is just some information to show you the available options that you have.

Thanks,
Shane