Change text of quantity HTML5 validation.
-
Hi there,
I am creating my first onine shop.
I am facing a problem in displaying custom message for quantity validation.
Stock quantity is not showing in product detail page but it is showing in cart page. I have share both pages screenshot below.
Product Detail: https://prntscr.com/93ajnj
Cart: https://prntscr.com/93ajukI have use below code in woocommerce>single-product>add-to-cart>variable.php
<?php foreach ( $attributes as $attribute_name => $ <tr> <td class="label"><label for="<?php echo sanitize_title( $attribute_name ); ?>"><?php echo wc_attribute_label( $attribute_name ); ?></label></td> <td class="value"> <?php $selected = isset( $_REQUEST[ 'attribute_' . sanitize_title( $attribute_name ) ] ) ? wc_clean( $_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 ? '<a class="reset_variations" href="#">' . __( 'Clear selection', 'woocommerce' ) . '</a>' : ''; ?> </td> </tr> <?php $variations_ob = ob_get_clean(); $variations_arr[wc_attribute_label($attribute_name)] = $variations_ob; endforeach; foreach ($variations_arr as $name => $ob) { echo str_ireplace('Choose an option', 'Select '.$name, $ob ); } ?>
Any help in this regards will be highly appreciated. Thanks in advance.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Change text of quantity HTML5 validation.’ is closed to new replies.