better-studio / better-amp

Full Google AMP support for WordPress with custom themes and customizations
https://betterstudio.com/wp-plugins/better-amp/
GNU General Public License v2.0
19 stars 19 forks source link

Simple add to cart button for variable WooCommerce product #36

Open galbaras opened 7 years ago

galbaras commented 7 years ago

When displaying products with several variations, both the shop page and the single product pages only show an "add to cart" button. When clicking it, WooCommerce prints a notice saying "Please choose product options...".

aliaghdam commented 7 years ago

@galbaras That is really hard to make it better because as you know AMP have complex and a log of validation roles! and the current version is the perfect way that we made it in the development time!

Do you any suggestion to make it available because we can not use JS?

galbaras commented 7 years ago

The best thing I can suggest is reaching out to the WooCommerce team and collaborating with them. Maybe you can also get ideas from https://wordpress.org/plugins/amp-woocommerce/, although I haven't checked it, or from https://codecanyon.net/item/wp-amp-accelerated-mobile-pages-for-wordpress-and-woocommerce/16278608, if you can get it.

Generally speaking, my approach would be to use WooCommerce hooks and replace JS-based elements with HTML ones. Since simply products already work, you only need to replace variation-related hooks.

I have a feeling that this will give your plugin a much wider distribution.