Manually removing the quantity selector from your theme when configuring Quantity Upsells
Relevant to:
Shopify Checkout Integration
Migrated Shopify Checkout Integration
Issue
You’re unable to remove the quantity selector from your theme using the theme editor or UI settings when configuring Quantity Upsells.
Environment
- Shopify Checkout Integration
- Migrated Shopify Checkout Integration
Resolution
Use this method if you’re unable to remove the quantity selector directly from your theme’s UI. The following code provides general guidance only and may not be compatible with all themes.
- In your theme files, open
cart-drawer.liquid. - Find an element that matches (or is similar to):
<quantity-input class="quantity cart-quantity">. - Just above that line, add the following code:
{% assign is_qty_upsell = false %} {% if item.selling_plan_allocation.selling_plan %} {% assign qty_opt = item.selling_plan_allocation.selling_plan.options | where: "name", "Product Quantity" | first %} {% if qty_opt and qty_opt.value != '0' %} {% assign is_qty_upsell = true %} {% endif %} {% endif %} {% unless is_qty_upsell %}
- Scroll down slightly to find the closing tag
</quantity-input>and add{% endunless %}immediately below it. - Review your changes:
- Add a product with a quantity upsell and a product with a standard subscription plan to your cart.
- Open your cart drawer (or full cart, if you’re editing there).
- You should now see that the quantity selector is hidden for products with a quantity upsell.
You can also make additional customizations to adjust the placement or visibility of the Delete button as needed.
Was this article helpful?
0 out of 0 found this helpful
