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.
-
Open product-form.liquid or main-product.liquid or wherever your product form lives.
-
Find the element for adding to cart.
-
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:
-
Go to cart.liquid or main-cart-items.liquid.
-
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.