Hi every body,

I am new in Drupal. I am using Drupal Commerce module to make an e-store. So I have a product name "Licence 1" it has an attribute (field) named "language pack price". in the other side I created a Line Item Type to add a field of language pack quantity to let customer put how many language packs he likes to add with his licence. It works like a charm. But now I would like to show the price of the language pack just after the field of the quantity so basically it is about showing a product field in the item line type. I just found the computed field module I thought it will help me to add a field in the "item line type" that contains a dynamic value got from the $entity variable. When testing it I just put :

$entity_field[0]['value'] = "test";

in the Computed Code (PHP) field
and left

$display_output = $entity_field_item['value'];

in the Display Code (PHP) field

then I checked "Include this field on Add to Cart forms for line items of this type."

but in the add to card page nothing has changed.

Comments

WorldFallz’s picture

I'm not exactly sure I understand what you're trying to do, but 'add to cart' is a form and computed_fields don't show on forms-- only upon display.

9802008’s picture

Have asked a similar question over here on Drupal Commerce: https://drupalcommerce.org/questions/30968/dynamic-field-type-line-items...