I would like to automate a process I am doing manually at the moment.
I know what I want to accomplish but not sure which direction to go but I think Toolset would be a good fit to accomplish what I am trying to achieve.
This is what I have setup on the website
1. WooCommerce, where I have created 150 products, so I have a unique Permalink URL and a unique ID for each product.
2. A Portfolio plugin, where I have created 150 custom posts, each post is used to present a WooCommerce product, the custom post has the ability to add HTML code into a text field.
The Task to Be accomplished
The task is to create a "Buy Now" button in the Portfolio HTML text field, the anchor for the button link is the WooCommerce product permalink and price.
Manual Method to complete the task
Currently I manually copy the Product permalink and paste it into the Portfolio HTML text field wrap it in the button attributes, repeat this for 150 Products/Portfolio Items
Automated Method to complete the task
Dynamically link the "Product ID" to the "Portfolio ID" and pull in the product permalink value and the price into the Portfolio HTML text field and wrap the button around the permalink.
I am certain this can be done but trying to figure out where to start is not as easy as I though so any help you can provide to get me started would be very welcome.
Thank you
Lee
Hello,
In your case, I suggest you try these:
1) Setup one-to-many relationship between post types "Product" and "Portfolio"
https://toolset.com/course-lesson/how-to-set-up-post-relationships-in-wordpress/
2) Edit each "Portfolio", connect it with specific "Product" post
3) In single "Portfolio" post, display the related "Product" post information:
https://toolset.com/course-lesson/displaying-related-posts/#displaying-one-related-item-parent
Thank you
I have accomplished step 1 and step 2 but step 3 is not so straightforward.
I think for the sake of getting the project completed I will manually add the product URL to the Portfolio pages until I have time to look at this again.
I am also looking at the plugin WP Data Access, it looks like a tool that could open up a lot of possibilities.
I will mark this ticket has resolved
My issue is resolved now. Thank you!