M
M
mUchenik2016-08-30 09:23:46
PHP
mUchenik, 2016-08-30 09:23:46

How to set the unit of measure in woocommerce?

Good day everyone!
Friends, tell me how to write "KG" in the field for entering the quantity, next to the number (in woocommerce, by default, it's just the number 1) 01bf9d81bf42490f832e553a648f4086.png
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pavel, 2016-08-30
@mUchenik

wp-content/plugins/woocommerce/templates/global/quantity-input.php - this template renders an input field
Copy to wp-content/themes/theme/woocommerce/global/quantity-input.php and change the markup as you need.

M
mUchenik, 2016-08-30
@mUchenik

if ( ! defined( 'ABSPATH' ) ) {
  exit; // Exit if accessed directly
}
?>
<div class="quantity">
  <input type="number" step="<?php echo esc_attr( $step ); ?>" min="<?php echo esc_attr( $min_value ); ?>" max="<?php echo esc_attr( $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' ) ?>" class="input-text qty text" size="4" pattern="<?php echo esc_attr( $pattern ); ?>" inputmode="<?php echo esc_attr( $inputmode ); ?>" />
</div>

What exactly is correct here?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question