Alter the Commerce product price programmatically

Public
</> CopyGet raw version
php
  1. $line_item->commerce_unit_price[LANGUAGE_NONE][0]['amount'] = $new_amount;
  2. $line_item->commerce_unit_price[LANGUAGE_NONE][0]['data']['components'][0]['price']['amount'] = $new_amount;
  3. commerce_line_item_save($line_item);