Last active
March 14, 2017 11:59
-
-
Save kurozumi/cb624639add388eb48838aa370b21dcc to your computer and use it in GitHub Desktop.
【EC-CUBE3】商品詳細ページからカートボタンを押した後の在庫数を取得するイベント
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 | |
/* | |
* This file is part of the Sample | |
* | |
* Copyright (C) 2017 サンプルプラグイン for EC-CUBE3 | |
* | |
* For the full copyright and license information, please view the LICENSE | |
* file that was distributed with this source code. | |
*/ | |
namespace Plugin\Sample; | |
use Eccube\Application; | |
use Eccube\Event\EventArgs; | |
class SampleEvent | |
{ | |
/** @var \Eccube\Application $app */ | |
private $app; | |
public function __construct(Application $app) | |
{ | |
$this->app = $app; | |
} | |
/** | |
* 商品詳細ページからカートボタンを押した時 | |
* | |
* @param EventArgs $event | |
*/ | |
public function onFrontProductDetailComplete(EventArgs $event) | |
{ | |
$form = $event->getArgument('form'); | |
$addCartData = $form->getData(); | |
$quantity = $this->app['eccube.service.cart']->getProductQuantity($addCartData["product_class_id"]); | |
echo $quantity; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment