Shopify themes, liquid, logos, and UX
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
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.
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:
<div class="product-form">
<label for="quantity">Quantity (25kg rolls):</label>
<input type="number" id="quantity" name="quantity" min="25" step="25" value="25" required>
</div>