How to Add Extra $10 Based on Custom Form Selection

Topic summary

A Shopify developer needs to dynamically add $10 to a product’s base price ($90 → $100) when customers select specific options through a custom JavaScript form collecting prescription details and lens preferences.

Current Issue:

  • Using /cart/add.js successfully sends custom line item properties
  • Cannot modify the price dynamically for a single cart line item
  • Not on Shopify Plus (which would enable Cart Transform functions)

Attempted Solutions (unsuccessful):

  • Adding a separate fee product (creates unwanted separate line item)
  • Custom properties (don’t affect pricing)
  • Shopify Functions (requires Plus plan)

Suggested Approaches:

  • Use product variants with different prices if the option is intrinsic to the merchandise (recommended for proper product options vs. line item properties)
  • Swap to a different product at checkout with the correct price point (may require inventory syncing and hiding duplicate products)
  • Draft orders with custom items via automation tools like Mechanic
  • Bundled product approach (less elegant)

Key advice: Clearly distinguish between actual product options (which should be variants) versus metadata/line item properties, as this affects the appropriate solution.

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

Hi everyone,

I’ve built a custom product form on my Shopify product page using JavaScript.
The form collects details like prescription info, lens type, and file uploads — here’s the setup:

  • Base product price: $90

  • If the customer selects a certain option (e.g. “Custom Lens Type”), I want to add $10 to the product price
    → So the total becomes $100

  • All of this should be for one product line in the cart — not as a separate add-on or extra product.

Currently, my script uses /cart/add.js to send the form data and custom line item properties.
Everything works fine except I can’t find a way to increase the price dynamically before adding to the cart.

Here’s what I’ve already tried:

  • Adding a “fee” product (works technically but shows as a separate line in cart/checkout — not ideal)

  • Sending custom properties with the base product (but properties don’t affect the price)

  • Looked into Shopify Functions / Cart Transform, but I’m not on Shopify Plus

1 Like

Hi @m.abdullah :waving_hand:
Crudest fix is to do this as a bundled product, but that may not account for other upstream/downstream considerations/inflexibility that force you to having a single-line item.
A bit more elegant is custom-items in draft orders
e.g. https://tasks.mechanic.dev/create-a-draft-order-from-the-cart

Reach out to me if you need such automations, or theme customization built.
:speaking_head: Click profile pic on forums for options

Why can’t the variant just have a higher price already.
Anything intrinsic to the merchandise that affects price,sku,inventory should be a real productOption.
Before letting anything extrinsic/metadata be a productOption

Troubleshooting 101:
Unless your omitting the critical detail that some product-details ARE NOT ACTUAL OPTIONS but line-item-properties.
which I could assume based on the other parts of the description but that’s not a good way to solve this type of problem by saying one thing is a specific type of thing first then mentioning a different thing that it might be too.
Be very clear in which parts are which specific things from the lead in, ambiguity BURNS money and time.

Careful of dogma it can get in the way of seeing real solutions.
Just swap the less priced product for a separate completely different product at the correct price point.
e.g. sibling product, combined listing, etc
This can mean the problem of duplicating products, having to sync inventory, hiding dupe products on the storefront etc etc etc.

The only exception to this is if on a Shopify Plus plan then shopify-functions cart transform can be used to modify prices in checkout