Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In some cases it's useful to know if a line item presave handles an insertion or an update since some modifications have only to happen on one of these occasions.
Attached patches provide an ability to do so. I prefer the solution with the $op
parameter since there's less overhead (technical and documentation), while provide same functionality.
Comment | File | Size | Author |
---|---|---|---|
commerce-line-item-insert-update-presave-hooks.patch | 1.38 KB | das-peter | |
commerce-line-item-hook-presave-with-op-param.patch | 1.72 KB | das-peter | |
Comments
Comment #1
rszrama CreditAttribution: rszrama commentedCommitted a slightly altered version of the two separate hooks patch:
https://github.com/rszrama/drupalcommerce/commit/1cc1d06a83cc6548cf021a9...