Support » Plugin: WooCommerce » Woocommerce product attributes to be able to use as links/buttons

  • Resolved wowiwe

    (@wowiwe)


    We have attributes such as BROCHURE, SPECIFICATIONS, YOUTUBE, VIMEO and they all have a value which is displayed like you see on this page.

    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.

    There was a suggestion on https://nicolamustone.blog/2016/03/11/make-product-attributes-linkable/ but neither adding the code to functions.php or in a code snippets worked, it rendered a code error 500.

    Is there another solution to this? Thank you.

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • 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.

    Thread Starter wowiwe

    (@wowiwe)

    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.

    Thread Starter wowiwe

    (@wowiwe)

    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.

    Plugin Support xue28 (woo-hc)

    (@xue28)

    Hi @wowiwe

    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!

    Plugin Support Gabriel – a11n

    (@gabrielfuentes)

    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.

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.