Use field from node reference for calculation

Created on 9 January 2025, 3 months ago

I want to create a cart based on webform and a product conent type.
- The content type contains a field "price" (decimal number)
- A user should be able to select multiple products and should be able to add a quantity per product

I am able to add the products with price by creating an entity_reference view containing title + price of the products
We can add the node reference as checkbox - so the multi selection is possible

What I can't figure out is:
- how to add a quantitiy input to each referenced product within the webform
- how to use e.g. "Computed Twig" component to calculate the
quantity * product price (from referenced node) and sum up the single row value.

e.g
Product 1: 3 x 100 $ = 300 $
Product 2: 2 x 75 $ = 150 $

Sum: 450 $

Any idea on how to solve this?

✨ Feature request
Status

Active

Version

6.2

Component

Documentation

Created by

πŸ‡©πŸ‡ͺGermany vistree

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024