• Resolved shaunhaage

    (@shaunhaage)


    Our site is using variation swatches consistently across most of our products.

    I am looking to add a stock status next to our sizes variation.

    When we werent using swatches using the woocommerce_dropdown_variation_attribute_options_html hook natively was working, however now that we are using swatches, this method no longer works.

    add_filter( 'woocommerce_dropdown_variation_attribute_options_html', 'variations_options_html_callback', 30, 2);

    function variations_options_html_callback( $html, $args ){

    $args = wp_parse_args( apply_filters( 'woocommerce_dropdown_variation_attribute_options_args', $args ), array(
    'options' => false,
    'attribute' => false,
    'product' => false,
    'selected' => false,
    'name' => '',
    'id' => '',
    'class' => '',
    'show_option_none' => __( 'Choose an option', 'woocommerce' ),
    ));
    .
    .
    .
    }

    Does anyone have any ideas on how I can add customisations to the drop-downs public function to achieve this.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Support fizanzvai

    (@fizanzvai)

    Hi,

    Thanks for reaching out to us.

    Please check this filter woo_variation_swatches_html inside our plugin and change $args as per your need.

    You should use this hook woo_variation_swatches_html instead this hook woocommerce_dropdown_variation_attribute_options_html when you are using our plugin.

    I hope this will help.

    Thank You

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.