-
AuthorPosts
-
October 10, 2017 at 10:16 am #862390
Hi team,
is it possible to present the quantity +/- button as drown field?
The alternative could be to hide the quantity button..
Hope you can help!
Best regards
Alexander
October 10, 2017 at 4:46 pm #862532Hi team,
i found myselve the solution:
1 .Just copy below mentioned code and paste it in a new file :<?php
/**
* Product quantity inputs
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.4.7
*/if ( ! defined( ‘ABSPATH’ ) ) exit; // Exit if accessed directly
global $product;
$defaults = array(
‘max_value’ => apply_filters( ‘woocommerce_quantity_input_max’, ”, $product ),
‘min_value’ => apply_filters( ‘woocommerce_quantity_input_min’, ”, $product ),
‘step’ => apply_filters( ‘woocommerce_quantity_input_step’, ‘1’, $product ),
);if ( ! empty( $defaults[‘min_value’] ) )
$min = $defaults[‘min_value’];
else $min = 1;if ( ! empty( $defaults[‘max_value’] ) )
$max = $defaults[‘max_value’];
else $max = 10;if ( ! empty( $defaults[‘step’] ) )
$step = $defaults[‘step’];
else $step = 1;?>
<div class=”quantity_select”>
<select name=”<?php echo esc_attr( $input_name ); ?>” title=”<?php _ex( ‘Qty’, ‘Product quantity input tooltip’, ‘woocommerce’ ) ?>” class=”qty”>
<?php
for ( $count = $min; $count <= $max; $count = $count+$step ) {
if ( $count == $input_value )
$selected = ‘ selected’;
else $selected = ”;
echo ‘<option value=”‘ . $count . ‘”‘ . $selected . ‘>’ . $count . ‘</option>’;
}
?>
</select>
</div>2. Save that file and name it “quantity-input.php”
3. Paste this file in your woocommerce folder “yourthemefolder/woocommerce/global/quantity-input.php”
4. Its done.
Works great! ;-)
Alexander
- This reply was modified 7 years, 2 months ago by alexandernoe.
October 12, 2017 at 6:24 am #863173 -
AuthorPosts
- You must be logged in to reply to this topic.