Dear @Emfab ,
Thank you for sharing your problem in the Shopify community.
I have visited your webshop. Your problem can be resolved using javascript.
If you are not able to do this. I can resolve this problem.
For this purpose, you have to provide me Access in store.
I have sent you an access request from my Shopify partner account. Kindly accept my request.
sorry, I should have warned you about this side effect.
Probably the preferred way to go is to use an alternative product template for the product where you want to increase by five.
Move to the template section in your theme code and create a new template named maybe product.inc5.liquid and copy the content of the file product.liquid into it. Replace {% section ‘product-template’ %} with {%section ‘product-inc5-template’ %}. (I have not your theme in front of me, but maybe it still applies or you get the idea. Later you can select for the products where you require the increments of 5 the template product-inc5 see below step 4).
Create a new file product-inc5-template.liquid in the sections folder. This is the file which will be used in the product.inc5.liquid file you created in step 1. Now copy the content of product-template.liquid in the sections folder into your new file. Now search for “product-page-qty .minus_btn” and replace .minus_btn with .minus_5_btn. Do the same to the .plus_btn. This way you have new classes to which you can assign functions.
Go to the script.js file in the assets folder. Now replace the $container.find("product-page-qty .minus_btn) with $contabutiner.find("product-page-qty .minus_5_btn) which will tie the function on the buttons you modified in your file product-inc5-template.liquid. If you now also add the original definition of $container.find("product-page-qty .minus_btn) (and .plus_btn). The function tied to .minus_5_btn will now work on buttons identified with .minus_5_btn and the functions tied to the original “.minus_btn” will work as before.
Do not forget to select the template product.inc5 on the Shopify admin for the products the 5 step in- and decrements apply.
Please let me know if this works - again I did not test it.
It it works I would appreciate if you accept my solution.
Search for #content .pro_main_c .desc_blk .desc_blk_bot .minus_btn and copy the content to the end of the file styles.scss.liquid. (You could edit the section in place but I prefer to either put it into a separate file or at the end of the main style file with additional comments.)
Then replace .plus_btn with .plus_5_btn and .minus_5_btn
It should like somehow similar to the lines below, but here I used your .css file after the Liquid engine worked on it. So in the file styles.scss.liquid you should find some liquid code in these declarations.
I have the exact same problem. I am listing the product on per kilogram price but my packages are 25 and 30 kg. My product’s quantity should start from 25 or 30 and should increase on their times.
I have zero experince on shopify and programming. How can I apply these modifications.
you are using the theme Minimal. It is much simpler there. In the Shopify Admin just go to your Online Store->Themes->Actions->Edit Code. Then in the folder ‘Sections’ open the file ‘product-template.liquid’ and search for product-single__quantity. Then add to the input tag the attribute step=30 so that it looks like
Be aware that this will applied to all of your products. If this is a problem you have to set up different templates for the products which you can then select when you add products.
If you are only selling whole bags, another way you could do it would be to have quantity set to 1 (1 bag), display a price per bag and also display price per kg. This way you won’t need different product templates. You can display 2 prices using sections of the code below.
{% assign productPriceMetre = product.selected_or_first_available_variant.price | times: 10 %}
{% assign productPriceMetreCompare = product.selected_or_first_available_variant.compare_at_price | times: 10 %}
{% unless product.price_max == 0 and settings.custom_price0_text != blank %}
{% if product.vendor != 'Unit' %}
AU {{ productPriceMetre | money }} per metre
AU {{ product.selected_or_first_available_variant.price | money }} per 0.1 metre
{% else %}
AU {{ product.selected_or_first_available_variant.price | money }}
{% endif %}
{% else %}
{{settings.custom_price0_text }} per 0.1 metre
{% endunless %}
{% if product.selected_or_first_available_variant.price < product.selected_or_first_available_variant.compare_at_price %}
{% if product.vendor != 'Unit' %}
AU {{ productPriceMetreCompare | money }} per metre
{% else %}
AU {{ product.selected_or_first_available_variant.compare_at_price | money }}
{% endif %}
{% endif %}
In your case you can use the product.vendor to set the different bag weights to the different products. Eg. product.vendor = “Bag 25” would divide the price per bag by 25 and product.vendor = “Bag 30” would divide the price per bag by 30 to give you price per kg.
I am trying to do the exact same thing for my store.
My theme is Venture and I dont see the script.js file so assume this is theme related.
I have created a new product template, and have linked it to a new section. The page is loading as expected but the multiples requirement is NOT working as expected. Below is an extract of the coding from the section:
{{ 'products.product.quantity' | t }}
When I load the page the qty starts on 3 unit, but clicking the + or - button allows you to move 1 unit, I would like this to move 3 units.
Im guessing this now links to some java script somewhere as well?
Surely this would change the button settings for all of my products? I just want it specifically for this template, the rest of my products will utilize the original template.
yes, that is the reason I wrote “define your own style class and functionality”. So just make a copy of the code define your own class and put it into your template. If your are not comfortable with that let me know.
One concern, I’ve tried another method which essentially worked, but when added it to the cart, and then moved to the shopping cart I was then able to make changes to the qty 1 unit at a time, which essentially defeats the purpose of the change. So the product page worked but the shopping cart didn’t recognize the change - if that makes sense?