How to Add product type donation into cart programmatically with custom amount(100 or 200 or something)? I am using commerce_donate module and I want to add a product (type=donation) into cart programmatically with the amount set as per the user has already selected on some other page. On some custom form submit, I want to add this donation type product into cart in order to process the usual commerce order / checkout.

How can I achieve this ?

Thanks.
No code needed, just watch the video about "Donations with Custom Line Item Types in Drupal Commerce". Some more details about it (= quote from that link):


  This screencast shows how to use a custom line item type to allow your customer to specify a user-defined amount to donate. The line item has a Donation Amount field on it, and we then create a product display node that uses that custom line item. Finally, we use a custom rule to update the "price" of the donation product to the amount the customer has chosen.