Drupal Commerce
5 articles on Drupal Commerce, each a problem from production engineering work and how it was solved.
-
Replaying one Drupal Commerce order place subscriber on demand
Build the WorkflowTransitionEvent yourself and call the one subscriber method, behind an admin-only form, instead of re-dispatching the event.
-
Splitting a Drupal Commerce order fee across items for Salesforce
In a Salesforce Suite push params subscriber, find the order, give each item a price-weighted share of the fee, and put leftover cents somewhere.
-
Drupal Commerce receipt emails with an empty body: service destruct order
Receipts sent during service destruction need the theme registry, so give theme.registry the lowest needs_destruction priority to make it destruct last.
-
Commerce Stripe and Stripe Link: when a paid order stays in draft
Commerce Stripe throws HardDeclineException for the card brand "link" after Stripe has taken the money. Catch it, store the method non-reusable, log.
-
Show a Drupal Commerce checkout pane only for card payments
Ajax-replaced payment radios rule out #states, so toggle the pane with a data attribute and skip its validation server-side when hidden.