A
A
awak6e2020-07-06 10:15:40
WordPress
awak6e, 2020-07-06 10:15:40

Woocommerce display product variations in catalog?

Hello. There are various products with different colors. How to display variations of these products in the catalog?
Or, if you keep them simple, how can you make a color choice in the products so that the client does not have to go back to the catalog and look for other colors?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Mikhail Lebedev, 2020-11-19
@zaza41rus

copy-paste to theme theme/woocommerce/content-product.php
comment it out and then add:

// do_action( 'woocommerce_after_shop_loop_item' );
  if($product->get_type() == "variable"){
echo '</a>';
woocommerce_variable_add_to_cart();
} else {
echo '</a>';
woocommerce_template_loop_add_to_cart();
}

for ajax to work - install the woocommerce-ajax-add-to-cart-for-variable-products plugin,
like everything I did (and it’s also very convenient to make the variation buttons wc-variations-radio-buttons checkboxes and style them as you need css )

A
aleksandrgilarov, 2020-07-06
@aleksandrgilarov

https://wordpress.org/plugins/woo-variation-swatch...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question