I Want to Hide the +1 Variant (From Quantity Breaks) in the Upsell Window
If you would like to hide the 1+ variant from Quantity Breaks in the Upsell window, please follow these steps:
From the Shopify admin, navigate to Sales channels > Online Store > Themes.
Click the ellipsis next to your desired theme, and select Edit code.
Under Snippets, create a new snippet file titled "bold-custom".
- Enter this code into the file:
<script> jQuery(window).bind("load", function () { $( "#upsell_upsell_form #var_id" ).each(function( index ) { $QB_var = $(this).text().trim(); console.log($QB_var, typeof($QB_var), $QB_var.slice(0,1), $QB_var.length); if ($QB_var.slice(0, 1) == "1" && $QB_var.length <= 4 ) { $(this).remove(); } }); }); </script> Select Save.
Under Layout, select theme.liquid.
Copy and paste the following code directly below the {{ content_for_header }}line:
{%- render 'bold-custom' -%}-
Select Save.