Enable or disable in-cart editing, and change the way in which customers can edit their items. And enable or disable the Shopify Discount Code box on the Cart Page.
Enable Edit in Cart
- This option will let customers edit the options they’ve selected from the cart page without starting over from scratch.
- If you want to enable Edit Options on the Cart Page, you have to go to the Cart Template Section.liquid to paste the following code into your cart page product details grid section (if your template contains sections, you must select the cart template.liquid section:
{% assign property_size = item.properties | size %}
{% if property_size > 0 %}
{%- comment -%}{% for p in item.properties %}
{% assign first_character_in_key = p.first | truncate: 1, '' %}
{% unless p.last == blank or first_character_in_key == '_' %}
{{ p.first }}:
{% if p.last contains '/uploads/' %}
<a href="{{ p.last }}">{{ p.last | split: '/' | last }}</a>
{% else %}
{{ p.last }}
{% endif %}
<br>
{% endunless %}
{% endfor %}{%- endcomment -%}{%- for p in item.properties -%}
{%- unless p.last == blank -%}
<li class="product-details__item product-details__item--property{%if property_size == 0%} hide{% endif %}" data-cart-item-property>
<span class="product-details__item-label" data-cart-item-property-name>{{ p.first }}: </span>
{%- comment -%}
Check if there was an uploaded file associated
{%- endcomment -%}
<span data-cart-item-property-value>
{%- if p.last contains "uploads" -%}
<a href="{{ p.last }}">Uploaded File</a>
{%- else -%}
{{ p.last }}
{%- endif -%}
</span>
</li>
{%- endunless -%}
{%- endfor -%}
<button type="button" class="edit_cart_option btn btn--primary button" data-product_id="{{item.product_id}}" data-key="{{item.key}}" data-variant_id="{{item.variant_id}}" data-quantity="{{item.quantity}}">Edit Options</button>
{% endif %}
- The above code will display the Edit Option in the cart page.
Enable Discount code box
- If our app's product options are being used by a store, then your discount code box on the checkout page will be disabled as it is incompatible with our app.
- However, to resolve this issue, we can place your discount code box on the cart page. This would mean that, if our app's product options are being used, the discount code box will appear on the cart page, and if our app is not used, it will appear on the checkout page.
- In both scenarios, your customers will be able to apply the discount codes to your product.
- If we want to enable the Discount Code Box in the theme, we need to paste the following codes in the Cart Page’s liquid file:
<div class="discount_code_box">
<div class='hulkapps_discount_hide'>
<input placeholder="Discount code" class="hulkapps_discount_code"
autocomplete="off" aria-required="true" size="30" type="text" name="checkout_discount">
<button type="button" class="hulkapps_discount_button btn btn--primary button">Apply</button>
</div>
</div>
- Search for the cart.liquid / cart-template.liquid file in your theme coding.
NOTE: If cart-template.liquid file is available, then please make the changes in the cart-template.liquid file only, as all the coding of “cart.liquid” will be included in this file.
Place the copied code wherever you need the discount code box to be displayed.