I think it's more useful to return the used , probably new, line item object instead the order in commerce_cart_product_add().
This since it's easier to load the appropriate order object afterwards than iterating over all line item objects to find the newly added one.
I quickly searched in the code and it looks like the return of the function is not used anywhere yet. Thus the change shouldn't have a big impact.
| Comment | File | Size | Author |
|---|---|---|---|
| commerce-return-line-item-instead-order-on-add-to-cart-action.patch | 1.02 KB | das-peter |
Comments
Comment #1
rszrama commentedTagging.
Comment #2
rszrama commentedCommitted w/ an update to the only test using this API function.
https://github.com/rszrama/drupalcommerce/commit/413928e934758e669e97713...