Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am creating a "sampler" of my different flavors of popcorn. I want the user to choose three different products then Add to Cart. Each flavor has a different price and a different weight (for use with Commerce UPS).
I added three product reference fields. The flavors all show up perfectly. However, when I choose three flavors and Add to Cart, the price and weight don't reflect those three flavors.
Is it not possible to add those three products via product reference fields?
Comments
Comment #1
griz CreditAttribution: griz commentedThis is done via the Rules module. On event 'calculate a price' you need to add an amount to the unit price.
Add the condition 'Entity has field' first to make the field accessible, then use data selection to get the price of your referenced product.
Comment #2
nvahalik CreditAttribution: nvahalik at Centarro commentedThis functionality would likely be better served by Commerce Bundle. This module handles customization of a single line item item. You're wanting to create multiple line items.