Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add event trigger to deleteAddressById method in the Addresses service. #810

Merged
merged 2 commits into from
Apr 3, 2019
Merged

Add event trigger to deleteAddressById method in the Addresses service. #810

merged 2 commits into from
Apr 3, 2019

Conversation

cimocimocimo
Copy link
Contributor

We are building a Gateway plugin for Craft Commerce and need a way to remove addresses from the gateway when a customer deletes an address from Commerce. I've added an event trigger to the deleteAddressById method that we can listen for and then run our own gateway code.

I reused the AddressEvent class and only needed to add a call to getAddressById to get the AddressModel of the address that was being deleted. I would be interested in feedback or suggestions for improvement.

Also, I made a simple typo correction in the documentation comment of the other events in the Addresses service class.

@lukeholder lukeholder merged commit 097bfc7 into craftcms:develop Apr 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants