Home Forums WoodMart support forum Quantity plus button missing Reply To: Quantity plus button missing

#129783

Timvp
Participant

Thanx for the reply. I fixed it.

This is a part of the theme code in quantity-input.php

<input
  type="number"
  id="<?php echo esc_attr( $input_id ); ?>"
  class="input-text qty text"
  step="<?php echo esc_attr( $step ); ?>"
  min="<?php echo esc_attr( $min_value ); ?>"
  max="<?php echo esc_attr( 0 < $max_value ? $max_value : '' ); ?>"
  name="<?php echo esc_attr( $input_name ); ?>"
  value="<?php echo esc_attr( $input_value ); ?>"
  title="<?php echo esc_attr_x( 'Qty', 'Product quantity input tooltip', 'woocommerce' ); ?>"
  size="4"
  pattern="<?php echo esc_attr( $pattern ); ?>"
  inputmode="<?php echo esc_attr( $inputmode ); ?>"
  <?php if ( ! empty( $labelledby ) ) { ?>
  aria-labelledby="<?php echo esc_attr( $labelledby ); ?>" />
  <?php } ?> 
  <input type="button" value="+" class="plus" /> 

But if the $labelledby is empty the <input> tag will not be closed.
I changed the last part to:

<?php if ( ! empty( $labelledby ) ) { ?>
 aria-labelledby="<?php echo esc_attr( $labelledby ); ?>" />
 <?php } else { ?>
 />
 <?php } ?>
 <input type="button" value="+" class="plus" />

Now it works again!