-
-
Save cjsaylor/9acaa7d1504e57ece36e to your computer and use it in GitHub Desktop.
application_event_for_plugin_blog_3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function addItem(Item $item, $quantity) { | |
// Trigger event before the item is added | |
EventManager::trigger('cart.before-add', compact('item', 'quantity')); | |
// Some cart logic here to add the item | |
// Trigger event after the item is added | |
EventManager::trigger('cart.after-add', compact('item', 'quantity')); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment