breadcrumb.php
2 years ago
form-login.php
2 years ago
quantity-input.php
2 years ago
sidebar.php
2 years ago
wrapper-end.php
2 years ago
wrapper-start.php
2 years ago
quantity-input.php
65 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Product quantity inputs |
| 4 | * |
| 5 | * This template can be overridden by copying it to yourtheme/woocommerce/global/quantity-input.php. |
| 6 | * |
| 7 | * HOWEVER, on occasion WooCommerce will need to update template files and you |
| 8 | * (the theme developer) will need to copy the new files to your theme to |
| 9 | * maintain compatibility. We try to do this as little as possible, but it does |
| 10 | * happen. When this occurs the version of the template file will be bumped and |
| 11 | * the readme will list any important changes. |
| 12 | * |
| 13 | * @see https://woo.com/document/template-structure/ |
| 14 | * @package WooCommerce\Templates |
| 15 | * @version 7.8.0 |
| 16 | * |
| 17 | * @var bool $readonly If the input should be set to readonly mode. |
| 18 | * @var string $type The input type attribute. |
| 19 | */ |
| 20 | |
| 21 | defined( 'ABSPATH' ) || exit; |
| 22 | |
| 23 | /* translators: %s: Quantity. */ |
| 24 | $label = ! empty( $args['product_name'] ) ? sprintf( esc_html__( '%s quantity', 'woocommerce' ), wp_strip_all_tags( $args['product_name'] ) ) : esc_html__( 'Quantity', 'woocommerce' ); |
| 25 | |
| 26 | ?> |
| 27 | <div class="quantity"> |
| 28 | <?php |
| 29 | /** |
| 30 | * Hook to output something before the quantity input field. |
| 31 | * |
| 32 | * @since 7.2.0 |
| 33 | */ |
| 34 | do_action( 'woocommerce_before_quantity_input_field' ); |
| 35 | ?> |
| 36 | <label class="screen-reader-text" for="<?php echo esc_attr( $input_id ); ?>"><?php echo esc_attr( $label ); ?></label> |
| 37 | <input |
| 38 | type="<?php echo esc_attr( $type ); ?>" |
| 39 | <?php echo $readonly ? 'readonly="readonly"' : ''; ?> |
| 40 | id="<?php echo esc_attr( $input_id ); ?>" |
| 41 | class="<?php echo esc_attr( join( ' ', (array) $classes ) ); ?>" |
| 42 | name="<?php echo esc_attr( $input_name ); ?>" |
| 43 | value="<?php echo esc_attr( $input_value ); ?>" |
| 44 | aria-label="<?php esc_attr_e( 'Product quantity', 'woocommerce' ); ?>" |
| 45 | size="4" |
| 46 | min="<?php echo esc_attr( $min_value ); ?>" |
| 47 | max="<?php echo esc_attr( 0 < $max_value ? $max_value : '' ); ?>" |
| 48 | <?php if ( ! $readonly ) : ?> |
| 49 | step="<?php echo esc_attr( $step ); ?>" |
| 50 | placeholder="<?php echo esc_attr( $placeholder ); ?>" |
| 51 | inputmode="<?php echo esc_attr( $inputmode ); ?>" |
| 52 | autocomplete="<?php echo esc_attr( isset( $autocomplete ) ? $autocomplete : 'on' ); ?>" |
| 53 | <?php endif; ?> |
| 54 | /> |
| 55 | <?php |
| 56 | /** |
| 57 | * Hook to output something after quantity input field |
| 58 | * |
| 59 | * @since 3.6.0 |
| 60 | */ |
| 61 | do_action( 'woocommerce_after_quantity_input_field' ); |
| 62 | ?> |
| 63 | </div> |
| 64 | <?php |
| 65 |