A bit of help with tpl_pi_qty_input.php

Open to all! Ask other shopowners for help.
Post Reply
14Steve14
Senior Contributor
Posts: 923
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

A bit of help with tpl_pi_qty_input.php

Post by 14Steve14 »

I am adjusting the layout of the product page and have it set as per the attached image.

The quantity input box was narrower than the stock level box so I want to make it the same height so it all lines up in the row. I have added btn_lg to the two end buttons, but how do I make the input box in the middle higher so it is the same height as the buttons on the ends?

Code: Select all

<div class="input-group">
    <div class="input-group-prepend">
      <?php
      if (PI_QTY_INPUT_BUTTONS == 'True') {
        ?>
        <button class="btn btn-info btn-lg spinner" type="button" data-spin="minus">
          <i class="fa fa-minus"></i>
        </button>
        <?php
      } else {
        ?>
          <div class="input-group-text"><?= PI_QTY_INPUT_BUTTON_TEXT ?></div>
        <?php
      }
      ?>
    </div>
    <?php
    echo (new Input('qty', ['min' => '1', 'class' => 'form-control form-control', 'id' => 'pi-qty-input'], 'number'))->default_value('1');

    if (PI_QTY_INPUT_BUTTONS == 'True') {
    ?>
    <div class="input-group-append">
      <button class="btn btn-info btn-lg spinner" type="button" data-spin="plus">
        <i class="fa fa-plus"></i>
      </button>
    </div>
      <?php
    }
    ?>
  </div>
input-box.png


Join The Code Co-op to get access to your library in the Code Co-op Forum
User avatar
burt
Core Team
Posts: 4561
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 413 times

Re: A bit of help with tpl_pi_qty_input.php

Post by burt »

https://getbootstrap.com/docs/4.6/compo ... ms/#sizing

should do you. Post back if it doesnt make sense.
I am not here to build for you.
I am here to build with you. Let's help each other.
14Steve14
Senior Contributor
Posts: 923
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

Re: A bit of help with tpl_pi_qty_input.php

Post by 14Steve14 »

Many thanks @burt For the life of me I could not find anything about form control when I looked. That page was a great help and now everything lines up as it should.
User avatar
burt
Core Team
Posts: 4561
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 413 times

Re: A bit of help with tpl_pi_qty_input.php

Post by burt »

It looks like you can set the size on the input-group div and remove the sizing from the elements contained inside that div, see;

https://getbootstrap.com/docs/4.0/compo ... up/#sizing

Something like;

Code: Select all

<div class="input-group input-group-lg">
  <div class="input-group-prepend">
    <button class="btn btn-info" type="button">-</button>
  </div>
  <input type="text" class="form-control">
  <div class="input-group-append">
    <button class="btn btn-info" type="button">+</button>
  </div>
</div>
I am not here to build for you.
I am here to build with you. Let's help each other.


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply