Support » Plugin: WooCommerce » Default variation option selected without having to go through every Product

  • i want to have a default variation option selected without having to go through every Product in WooCommerce.
    in variable.php:

    <?php
    $selected = isset( $_REQUEST[ ‘attribute_’ . sanitize_title( $attribute_name ) ] ) ? wc_clean( stripslashes( urldecode( $_REQUEST[ ‘attribute_’ . sanitize_title( $attribute_name ) ] ) ) ) : $product->get_variation_default_attribute( $attribute_name );
    wc_dropdown_variation_attribute_options( array( ‘options’ => $options, ‘attribute’ => $attribute_name, ‘product’ => $product, ‘selected’ => $selected ) );
    echo end( $attribute_keys ) === $attribute_name ? apply_filters( ‘woocommerce_reset_variations_link’, ‘‘ . esc_html__( ‘Clear’, ‘woocommerce’ ) . ‘‘ ) : ”;
    ?>
    I would like to be able to modify it so that all my products have the first selected variable Thank you

  • The topic ‘Default variation option selected without having to go through every Product’ is closed to new replies.