This is essential if you want to operate reliably on the line item after it has been created.

CommentFileSizeAuthor
#2 return_the_line_item-2730367-2.patch0 bytesjoelpittet

Comments

rszrama created an issue. See original summary.

joelpittet’s picture

Status: Active » Fixed
StatusFileSize
new0 bytes

Looks like this is already done?

function commerce_discount_add_line_item(EntityDrupalWrapper $order_wrapper, $discount_name, $discount_amount, $data = array()) {
...
// Save the incoming line item now so we get its ID and add it to the oder's
  // line item reference field value.
  commerce_line_item_save($discount_line_item);
  $order_wrapper->commerce_line_items[] = $discount_line_item;

  return $discount_line_item;
}
joelpittet’s picture

Sorry for the patch, that's weird...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.