Skip Navigation

[Resolved] I would like to add attributes to the add to cart button

This support ticket is created 7 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 2 replies, has 2 voices.

Last updated by bradleyH-2 7 years, 3 months ago.

Assisted by: Luo Yang.

Author
Posts
#476286
layout-screen-two.png
layout screenshot.png

I am trying to:

I would like to add attributes to the add to cart button to add things like size and color and I would like them to fail if the product with those attributes does not exist.
OR I would like to display the options I can add with the product based on the availability (stock level) of an item with those attributes.

I am thinking this must be done on both the front end single Product template in coordination with the back end product template.
To further simplify design I would be willing to have the "add to cart" button link to the single product template to fill the details however a modal would be best as I don't like the idea of them losing thier place during thier shopping experience.

Thanks for your assistance with this in finding my best site wide UX for product interaction.

Bradley

I have enclosed my sample layout using boot strap that I created in my test site and I have plenty of room to add and move things around.

#476860

Dear bradley,

First you need to setup a variable product with Woocommerce plugin, see their document:
https://docs.woocommerce.com/document/variable-product/

Then you can use shortcode [wpv-woo-buy-or-select] from plugin "WooCommerce Views" to display the Select options button, see our document:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-woo-buy-or-select
For variable products, the user first has to select a product variation, the Select options button will take the user to the product detail page, where they can select a Variant and add it to the cart.

#477544

that did it thanks!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.