Answer the question
In order to leave comments, you need to log in
Linking a product to a Woocommerce+Wordpress article
Hello! There is an online store on WordPress. For products, articles like: "how to connect, how to use, features, reviews" are written. People from search engines come to these articles and, judging by their behavior, they do not always understand that they are in a store and the described product can be bought right here. I would like to add a neat plate like: "this article is about the product <product name>" in the header of the article. With current price and "add to cart" button. Now I mastered arbitrary fields for the article, where I set the product ID in the store. I found examples of how to extract the values of custom fields inside an article.
It remains to find an example of interaction with woocommerce, which allows you to extract the current price, a link to a thumbnail, and a product name by the Product ID. Will you help?
Answer the question
In order to leave comments, you need to log in
I won’t suggest a ready-made solution, but I think it’s worth looking for call functions in the WooCommerce documentation .
Also try to look at the template code for the product page. You may find the functions you need there.
www.advancedcustomfields.com - allows you to add a meta type "Attitude" for product posts.
Well, then, through a hook or editing the template, display those records that are related to the post.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question