Change with of my quantity selector

Solved
WahlkvistAlex
Tourist
12 1 2

Hi need help with my quantity selector. I want to change the with.

See picture.quantity selector.png

 

 

 

I use simple theme and the file is product-template.liquid

<!--   Quantity Selector   --> 
    <div class="mobileqty">
    <input type='button' value='-' class='qtyminus' field='quantity' onclick="TextBox_AddToIntValue('product-quantity-{{product.id}}',-1)" />
    
      <input type='text' name='quantity' value='1' class='qty' id="product-quantity-{{product.id}}"/>
    
    <input type='button' value='+' class='qtyplus' field='quantity' onclick="TextBox_AddToIntValue('product-quantity-{{product.id}}',+1)" />
            </div>
   <script>
jQuery(document).ready(function(){
    // This button will increment the value
    $('.qtyplus').click(function(e){
        // Stop acting like a button
        e.preventDefault();
        // Get the field name
        fieldName = $(this).attr('field');
        // Get its current value
        var currentVal = parseInt($('input[name='+fieldName+']').val());
        // If is not undefined
        if (!isNaN(currentVal)) {
            // Increment
            $('input[name='+fieldName+']').val(currentVal + 1);
        } else {
            // Otherwise put a 0 there
            $('input[name='+fieldName+']').val(0);
        }
    });
    // This button will decrement the value till 0
    $(".qtyminus").click(function(e) {
        // Stop acting like a button
        e.preventDefault();
        // Get the field name
        fieldName = $(this).attr('field');
        // Get its current value
        var currentVal = parseInt($('input[name='+fieldName+']').val());
        // If it isn't undefined or its greater than 0
        if (!isNaN(currentVal) && currentVal > 0) {
            // Decrement one
            $('input[name='+fieldName+']').val(currentVal - 1);
        } else {
            // Otherwise put a 0 there
            $('input[name='+fieldName+']').val(0);
        }
    });
});
   </script>
              
            <!--   //Quantity Selector   -->   

 

0 Likes
renus
Shopify Partner
171 15 28

HI @WahlkvistAlex 

 

You want to change width ? can you share url please

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on renusharma7@gmail.com regarding any help
Shopify Expert | Skype : renusharma99
0 Likes
WahlkvistAlex
Tourist
12 1 2

Yes, sorry for misspelling.

www.smasha.se 

0 Likes
renus
Shopify Partner
171 15 28

This is an accepted solution.

hi @WahlkvistAlex 

use this css

.mobileqty .qty{ max-width:40px !important;}
If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on renusharma7@gmail.com regarding any help
Shopify Expert | Skype : renusharma99
WahlkvistAlex
Tourist
12 1 2

I do not know where to put this.

0 Likes
renus
Shopify Partner
171 15 28

go to assist -> style.css file add in this file or add me as staff account i will do this for you

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on renusharma7@gmail.com regarding any help
Shopify Expert | Skype : renusharma99
0 Likes
renus
Shopify Partner
171 15 28

@WahlkvistAlex 

Got The file?

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on renusharma7@gmail.com regarding any help
Shopify Expert | Skype : renusharma99
0 Likes
WahlkvistAlex
Tourist
12 1 2

How do I add you as staff account?

0 Likes
renus
Shopify Partner
171 15 28
 

Go to admin settings ->  click on plan and permission add me as staff

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on renusharma7@gmail.com regarding any help
Shopify Expert | Skype : renusharma99
0 Likes
WahlkvistAlex
Tourist
12 1 2

I have sent invitation

0 Likes