I was able to gracefully get the donation pane working on my own checkout flow by simply adding a donation item to all new orders inside of an EventSubscriber that reacts on OrderEvents::ORDER_CREATE. The cleanest way to do this was to just copy the bit logic from NewOrder->get() that handles adding the order item to the order. Attaching a patch that just breaks out that bit of logic into its own NewOrder->addDonationItem() method, allowing it to be implemented elsewhere via the service.

Comments

mrweiner created an issue. See original summary.

mrweiner’s picture

Status: Active » Needs review
StatusFileSize
new1.33 KB

  • FatherShawn committed 4b7e363 on 1.0.x
    Issue #3178281 by mrweiner: Create helper method to addDonationItem
    
fathershawn’s picture

Status: Needs review » Fixed
mrweiner’s picture

Thanks @FatherShawn!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

imclean’s picture

Version: 1.0.0-beta1 » 1.0.x-dev

This is very handy but it isn't included in beta1. I've just spent a bit of time refactoring things in much the same direction, only to discover this in the development version.

fathershawn’s picture

Maybe we need a beta2!