include stock status in drop for for size attribute
-
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)
Viewing 1 replies (of 1 total)
- You must be logged in to reply to this topic.