I am selling fabrics per roll. Each roll is 25kg each. The price in which we deal is per kg. I want to show the price in kg but when someone add it to cart they should only be able to add it in multiple of 25.
Topic summary
Goal: Display fabric pricing per kg while enforcing add-to-cart quantities in 25 kg increments (each roll = 25 kg).
Requests: A participant asked for more details and the store URL to clarify requirements.
Proposed solution: Edit the Shopify theme’s main-product.liquid (product page template) to restrict the quantity selector to multiples of 25. Use an HTML number input with min=25, step=25, and a default value of 25, labeled as “Quantity (25kg rolls).” A code snippet is central to the guidance.
Status: No confirmation of implementation yet; discussion remains open. Next steps include providing store details and testing/applying the suggested code.
Key terms: main-product.liquid = Shopify product page template file; quantity input = the field controlling how many units are added to cart.
Hi @Krish9870 , Could you please provide more details about this, as well as the store URL? This will help me better understand the requirements and assist you more effectively.
Thank you!
Hello @Krish9870
To achieve your goal of displaying the price per kg while allowing customers to add only multiples of 25 kg to the cart in your Shopify store, you can follow these steps:
You’ll need to edit you the main-product.liquid file
Modify the Quantity Input Field: Replace the quantity input with a custom field that only allows multiples of 25.
Here’s a basic example of how you might adjust the code: