How to add a chargeable add-on

Topic summary

A user seeks to add a chargeable optional add-on (checkbox with text and price) to product pages for a specific collection, without using paid apps or variants (already using volume discount app).

Proposed Solution:

  • One responder provided custom code to add a checkbox before the “Add to Cart” button that increases product price when selected
  • Code uses line item properties and can be inserted into product-form.liquid or main-product.liquid
  • Optional cart template modifications suggested to display the extra charge

Key Limitation:

  • The provided code would apply to all products, not just one collection
  • User confirmed they need it limited to a specific collection only

Alternative Perspective:

  • Another participant argued upsells are revenue generators worth paying for rather than DIY approaches
  • Suggested using existing gift-wrapping tutorials or hiring professional customization services

Status: Unresolved - the collection-specific requirement hasn’t been addressed in the proposed solution.

Summarized with AI on October 28. AI used: claude-sonnet-4-5-20250929.

Can anyone help me? I’m trying to place a chargeable optional add-on on the product page for products in a certain collection.

i can’t do it in variants as i already have volume discount with an app. I’m just after a little check box with text and price before the add to cart.
I have found apps that do this but the “chargeable” part is not part of the free plan and I already have so many apps I don’t want to pay anymore for such a little thing.
Thanks in advance

1 Like

hey @SunshineGraphic

What it does

Adds a checkbox before the Add to Cart button that increases the product price when selected.


Steps:1. Go to Shopify Admin → Online Store → Themes → Edit Code.

  1. Open product-form.liquid or main-product.liquid or wherever your product form lives.

  2. Find the element for adding to cart.

  3. Just above the “Add to cart” button, insert this code


  

Save the file.

Explanation:- The checkbox adds a custom line item property to the cart.

  • The price doesn’t update live on the product page, but you can handle this in the cart or checkout.

Optional (but recommended)

If you want to show the extra price in the cart, edit the cart template:

  1. Go to cart.liquid or main-cart-items.liquid.

  2. Inside the line item loop, add this:

{% for p in item.properties %}
  {% if p.first == 'Gift Wrap' and p.last == 'Yes' %}
    

Gift Wrap: +¥500

  {% endif %}
{% endfor %}

Add a note in the product description like

Gift wrap fee of ¥500 will be added at checkout.

if this code work please do not forget to like and mark it solution

Thank you for your help. However this would apply to all my products - is that correct? I only need it on one collection.

Hi @SunshineGraphic upsells are not a little thing they are revenue generators you can either burn time trying to DIY or just pay for money making tools.

upsells are an advanced theme customization or facilitated with an app.

If you must DIY and this must add and item with a price see the giftwrapping tutorials available online and that exists in many many previous discussions.

i.e. https://help.shopify.com/en/manual/online-store/themes/themes-by-shopify/vintage-themes/customizing-vintage-themes/add-gift-wrap-option

If you need this customization done for you so you can get back to bigger business issues then contact me for services.
Contact info in forum signature.
ALWAYS please provide context, examples: store url, theme name, post url(s) , or any further detail in ALL correspondence.