This is a low-tech alternative, but how about just adding the links or buttons to the WooCommerce Short Description for the product(s) instead of using attributes? It looks like it will put the data about where it is now with your current theme, require no additional functions.php code, and less work.
Thank you Linux4me2. It is great suggestion however the data was migrated from a Joomla website and we are looking at about 7000 records that would need to be changed.
That sounds like an opportunity to write a little PHP script to convert the attributes to the HTML you want and save it to the products’ Short Description.
If it were me, I’d do one manually, then look in the database to get the HTML WooCommerce created to use in the script.
With the script, you could also remove the attributes as you go.
I love your suggestion minus the bit to save it into the product’s short description. We still would like them as attributes.
Do you know of php scripts that could be called through a code snippet to add the option of an URL to the attribute to accomplish the task?
I don’t now of a script to add the URL to the attributes other than the one you linked to above, which I haven’t tested, though when I did a quick search, it looks like there are a number of search results related to doing it.
It might be worth trying to resolve the error you got when you tried the one above. Was there anything in your server error logs to indicate the cause of the error?
There’s also a WooCommerce snippet to add archive links, which you might be able to adapt to your needs.
Thanks for reaching out!
What we need to achieve is turning this values into buttons really and so far I have not been able to find a solution that would help with this.
I did some research and found these articles could be a good starting point:
Meanwhile, these forums are meant for general support with the core functionality of WooCommerce itself. What you want to achieve is a bit complex and would require customization to do it. Since custom coding is outside our scope of support, I am leaving this thread open for a bit to see if anyone can chime in to help you out.
For questions related to development and custom coding, your best bet is to ask on any of these channels for support. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, too.
Hope this helps!
We haven’t heard back from you in a while, so I’m going to mark this as resolved – we’ll be here if and/or when you are ready to continue.