Merge pull request #2524 from SteffenMahler/patch-2

Fire event if customer wants to "buy now"
This commit is contained in:
Jitendra Singh 2020-02-21 11:29:17 +05:30 committed by GitHub
commit e0b61c8a58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -98,6 +98,10 @@ class CartController extends Controller
*/
public function store($id)
{
if (request()->get('is_buy_now')) {
Event::dispatch('shop.item.buy-now', $id);
}
Event::dispatch('checkout.cart.item.add.before', $id);
$result = Cart::addProduct($id, request()->except('_token'));