Jump to content

Modify product quantity touchspin


DARKF3D3

Recommended Posts

  • 4 months later...
<div class="cart-input-wrapper">
	<div class="input-group bootstrap-touchspin">
      <span class="input-group-addon bootstrap-touchspin-prefix" style="display: none;"></span>
      <input style="width: 40px; display: block;" class="js-cart-line-product-quantity form-control" 
             data-down-url="op=down" 
             data-up-url="op=up" 
             data-update-url="" 
             data-product-id="idproduct" 
             type="number" 
             value="25" 
             name="product-quantity-spin" 
             min="1">
      <span class="input-group-addon bootstrap-touchspin-postfix" style="display: none;"></span>
      <span class="input-group-btn-vertical">
        <button class="btn btn-touchspin js-touchspin js-increase-product-quantity bootstrap-touchspin-up" type="button">
          <i class="material-icons touchspin-up"></i>
        </button>
        <button class="btn btn-touchspin js-touchspin js-decrease-product-quantity bootstrap-touchspin-down" type="button">
          <i class="material-icons touchspin-down"></i>
        </button>
      </span>
  </div>
</div> 

OK - so I have it wrapped in DIV. Looks OK but buttons with +/- are not inline.
It is preview of HTML that is generated by all js in Presta. I was thinking to change the CSS to make buttons looks in line like this: "-" "input" "+"

If I make it looks good it doesn't work as it should - buttons do not increase or decrease..
I do not want to change core files.

To tell the truth it is really annoying - such a simple and obvious thing and such a pain the a...

 

Edited by Butch0071 (see edit history)
Link to comment
Share on other sites

  • 1 year later...

Try this CSS, i used in theme WareHouse.
image.thumb.png.b3ca067d375b91cc54f7cdde8f5cf4e0.png

.bootstrap-touchspin {
    border-radius: 0px;
    overflow: hidden;
    border: 1px solid #979797;
    max-width: 9rem;
}
.bootstrap-touchspin .input-group-btn-vertical {
    position: static;
}
.bootstrap-touchspin .input-group-btn-vertical > .btn {
    width: 35%;
    height: 100% !important;
    border: none;
    padding: 0px;
    margin: 0px;
    background-color: transparent;
}
.bootstrap-touchspin .input-group-btn-vertical .btn i {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    top: 0px;
    height: 100%;
    color: #979797;
    width: 100%;
    justify-content: center;
    left: 0;
    font-size: 1.3rem;
}
.bootstrap-touchspin .input-group-btn-vertical .bootstrap-touchspin-up {
    position: absolute;
    right: 0;
}
.bootstrap-touchspin .input-group-btn-vertical .bootstrap-touchspin-up i:before {
    content: "\f067";
}
.bootstrap-touchspin .input-group-btn-vertical .bootstrap-touchspin-down {
    position: absolute;
    left: 0;
}
.bootstrap-touchspin .input-group-btn-vertical .bootstrap-touchspin-down i:before {
    content: "\f068";
}
.bootstrap-touchspin input {
    color: #979797 ;
    border: none;
}
.product-quantity .qty .input-group,
.block-cart-product-quantity {
    text-align: center !important;
    padding-top: 0;
    padding-bottom: 0;
    font-size: 1.4285714286rem;
}
.product-quantity .qty .input-group i.fa-angle-up {
    top: 0;
}
.js-cart-line-product-quantity {
    padding-top: 0;
    padding-bottom: 0;
}

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...