Hi 🙂
I'm trying to add price and add to cart button to a single event page (made with content template), this single event is a child of the product which price I want to show, and the product that should be added to cart, but it's not working, meaning I'm seeing same price and buying same product, from every single event page.
I'm sorry about the length of this, I have tried to explain in detailed points.
1. I created a content template for my custom post type "Events"
Single event page:
hidden link
Single event pages are built with a content template.
2. Then I created a parent/child relationship with products and events.
PARENT: PRODUCTS
CHILD: EVENTS
I don't know which one should be parent or child for this to work, I did it this way only because it is easier to select the related product from the "edit event" page, using the dropdown product search.
IMAGE: Selecting-related-product-from-edit-event-page.JPG
3. I created a product for each event.
Besides the shop, I also want the Event to be purchased from the single event page. (Meaning to purchase the product related to the current event - from the single event page)
- It is currently showing a price and a button on the single event page, but it's the same price (950 DKK) and the same product that will be added to cart, from every single event page.
I'm confused how to get the Product/Event relationship to work.
Price and button in content template:
The standard woocommerce fields didn't work, no data is displayed.
I created a view, but "Products" isn't a structured post type, so I can't make parent/child filters.
IMAGE: view-for-product-cart-button-and-price.jpg
Inserting view:
[wpv-view name="event-og-produkt-information" limit="1"]
This is just showing price and add to cart button for same product on all event pages.
---
Can you help me find out how to put product cart button and product price on the single event page, that will relate to the product set in post relationship?
Thank you for your time,
Best regards
Lykke