Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #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

    #862532

    Hi 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, 1 month ago by alexandernoe.
    #863173

    Hi,

    Awesome. Thanks for sharing and thank you for using Enfold! Have a nice day.

    Best regards,
    Ismael

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.