Cart Binding for Add-Price and Upsell Products
Plain-language implementation guide
When added to the cart, the main product and related products include hidden properties that define their binding relationship.
The main product contains:
_scm_bind = unique binding IDAn addPrice product contains:
_scm_bind_to = the main product’s _scm_bind
_scm_inject_type = addPrice
An upsell product contains:
_scm_bind_to = the main product’s _scm_bind
_scm_inject_type = upsell
Do not hard-code
addPriceorupselldetection from product titles, SKUs, handles, or product IDs. Use these hidden properties.
Implementation requirements
1. Read cart item properties
Parse the product attributes/properties/line item properties in the cart line items, and read:
_scm_bind_scm_bind_to_scm_inject_type_scm_bind_qty_scm_bind_delete
2. Establish the binding relationship
- Main product: has
_scm_bind. - Related product: has
_scm_bind_to. - When a related product’s
_scm_bind_toequals the main product’s_scm_bind, the two products are considered bound.
3. Add-on price product rules
_scm_inject_type = addPrice
Requirements:
- Do not allow independent removal.
- Do not allow manual quantity changes.
- The quantity must follow the main product.
- When the main product is removed, the bound
addPriceproduct must also be removed. - Displayed
addPriceprice =addPriceunit price × current quantity.
Note: Do not rely entirely on the
line_pricereturned by the cart API, as it may update more slowly thanquantityon some platforms or themes. Calculate the displayedaddPriceprice using unit price × quantity first.
4. Upsell product rules
_scm_inject_type = upsell
By default:
- Can be identified as a related product.
- Its quantity is not required to follow the main product.
- It can usually be removed independently.
5. Give rule fields priority
If rule fields are present, they take priority.
Quantity rules
_scm_bind_qty
Value | Meaning |
|---|---|
| Independent quantity changes are allowed. |
| Quantity changes are not allowed. |
| The quantity follows the main product. |
Deletion rules
_scm_bind_delete
Value | Meaning |
|---|---|
| Independent removal is allowed. |
| Independent removal is not allowed. |
6. Cart interaction requirements
When the main product quantity changes
- Find all
addPriceproducts where_scm_bind_toequals the main product’s_scm_bind. - Sync each
addPriceproduct’s quantity to the main product’s quantity. - Then refresh the cart UI, subtotal, and total.
When the main product is removed
- Find all
addPriceproducts where_scm_bind_toequals the main product’s_scm_bind. - Remove all of those
addPriceproducts. - Then refresh the cart UI, subtotal, and total.
7. UI requirements
addPrice products
- Hide the remove button.
- Hide the quantity increase/decrease controls.
- Display only the current quantity.
- Display the price as unit price × current quantity.
upsell products
- Do not mistakenly apply
addPrice’s strict binding logic unless_scm_bind_qtyor_scm_bind_deleteexplicitly requires it.
8. Compatibility requirements
Field names may differ across platforms. For example:
propertiesline_item.propertiesitem.propertiesattributeslineItemProperties
Please write a general-purpose reader that can extract _scm_* fields from objects, JSON strings, and property arrays.
9. Things not to do
- Do not hard-code product IDs.
- Do not hard-code SKUs.
- Do not hard-code product titles.
- Do not hard-code URL handles.
- Do not merely hide buttons without synchronizing the API.
- Do not update quantity without updating the displayed price.
- Do not change only the frontend while leaving
addPriceitems after the main product is deleted.
Final goal
- Users operate only the main product.
addPriceautomatically follows its quantity and deletion state.- Upsells are recognized without being incorrectly forced into strict binding.
- When new
addPriceorupsellproducts are added, no theme-code change is needed as long as their cart properties are correct.
Developer quick summary
In one sentence:
In the cart, implement related-product binding using
_scm_bind,_scm_bind_to, and_scm_inject_type. TheaddPriceproduct must follow the main product’s quantity.
Further Reading
Getting Started
- Connect Your Store
- Beginner Guide: Create Your First Customization Feature Step by Step
- How to Integrate a Customization Feature into a Product Landing Page (Product Detail Page)
Advanced Features
- Templates in CustoMeow
- Use Component Conditions to Control Whether Components Are Shown or Hidden
- What Can Workflow Do?
Add-on Pricing and Upselling
Updated on: 27/10/2026
Thank you!
