I’m building a WC website and I’d like to change the display of the attributes. Rather than display them as a dropdown form element, each attribute should be displayed as a text link. Here’s an example site that does it right with the shoe sizes: http://shop.nordstrom.com/s/vince-addie-sandal/3761939?origin=category
I purchased the Variations Swatches and Images plugin for the site. It works for product sizing (it’s easy to predict product sizes, so I could make the images) but the product colors are custom for each item (Berry, Turquoise, etc). The end client isn’t saavy enough to generate an image of text for every color possibility, however.
I considered converting the dropdown to radio buttons (seen here on SO), removing the radio elements, and styling the labels, but the WP plugin that’s available doesn’t generate valid labels to click on. Admittedly, my JS knowledge is limited to basic scripts and tinkering, so building a custom thing would be hard…
Any ideas of where to go from here would be appreciated. Here’s what I’m considering:
- Modifying the SO post from above to have valid labels and pray it works
- Adding in color swatches for the shoes as colors or text every time
- Leaving the colors as a drop down and asking client to work with it (not good)
HTML:
CSS:
Here’s a demo in jsfiddle.
Please let me know if you need any further assistance.
Edit
Okay, so the existing plugin doesn’t fit your needs exactly, so I modified it a bit.
/wp-content/plugins/woocommerce-improved-radio-buttons/woocommerce/assets/frontend/css/
and edit theadd-to-cart-variation.css
file to your liking;If you’re interested to see how the code looks like, feel free to look inside.
Let me know if this worked for you.