Notice: These forums are now retired and closed. For active support, please Submit a Ticket or visit our official WordPress.org community pages.
Kadence Theme | Kadence Blocks | Starter Templates | WooCommerce Email Designer | Ascend | Virtue | Pinnacle

BUG – Variations Radio Buttons And Images Woocommerce

Home / Forums / Virtue Theme / BUG – Variations Radio Buttons And Images Woocommerce

This topic is: Resolved
[Resolved]
Posted in: Virtue Theme
February 17, 2016 at 1:29 pm

Hi, this is a 2 part question related to product variations.

I have created a variable product, with images defined for each variation.

On the product page it is possible to show the image change as you select the different choices from the drop down variations

If I select Display variations as radio buttons instead of select box in the

product settings of the theme the images stop changing. (see screenshot #1)

radio buttons – select box bug
————————————————————————————-
Part 2 of question

I found a snippet of code to be pasted in functions file that enables selections to function on cat archive page (see image #2)

radio buttons – select box bug
——————————
//change variations on the category pages

if ( ! function_exists( 'woocommerce_template_loop_add_to_cart' ) ) {

function woocommerce_template_loop_add_to_cart() {
global $product;

if ($product->product_type == "variable" && (is_product() || is_product_category() || is_product_tag())) {
woocommerce_variable_add_to_cart();
}

else {
woocommerce_get_template( 'loop/add-to-cart.php' );
}
}

}

However it does not change the image if either choice of category select or radio buttons is used.

I prefere the radio buttons layout is it posible for a hack. fix of this snipet of code to enable the image change on archive pages AND can you make the radio buton change images on product page.

Many thanks sorry for the long queston, regards Lee

  • The forum ‘Virtue Theme’ is closed to new topics and replies.