商品情報、注文情報に「のし・ラッピングオプション」を追加するサンプルです。 3.n にて追加された拡張機能を使用して実装します。 以下のカスタマイズを実施します。
- 商品情報に「のし・ラッピング対応」フラグ追加
- 商品詳細に「のし・ラッピング対応」オプション表示
- のし・ラッピング種別マスタ追加(名称・追加料金)
- 注文画面に、のし・ラッピング選択・記載内容フォーム表示
// system/masterdata | |
$c->match('/setting/system/masterdata', '\Eccube\Controller\Admin\Setting\System\MasterdataController::index')->bind('admin_setting_system_masterdata'); | |
// 旧 | |
// $c->match('/setting/system/masterdata/edit', '\Eccube\Controller\Admin\Setting\System\MasterdataController::edit')->bind('admin_setting_system_masterdata_edit'); | |
// 新 | |
$c->match('/setting/system/masterdata/{entity}/edit', '\Eccube\Controller\Admin\Setting\System\MasterdataController::index') | |
->bind('admin_setting_system_masterdata_edit'); |
// 略 | |
// 規格2が設定されている | |
$this->tpl_classcat_find2 = $objProduct->classCat2_find; | |
$this->tpl_product_class_id = $objProduct->product_class_id; | |
$this->tpl_stock_find = $objProduct->stock_find; | |
SC_Utils_Ex::sfPrintR($objProduct->stock_find); // 追加 | |
break; | |
default: | |
break; | |
} |
// /data/class/SC_Product.php | |
/** | |
* 商品IDに紐づく商品規格を自分自身に設定する. | |
* | |
* 引数の商品IDの配列に紐づく商品規格を取得し, 自分自身のフィールドに | |
* 設定する. | |
* | |
* @param array $arrProductId 商品ID の配列 | |
* @param boolean $has_deleted 削除された商品規格も含む場合 true; 初期値 false |
// 略 | |
switch ($this->getMode()) { | |
case 'search': | |
$objProduct = new SC_Product_Ex(); | |
$this->arrForm = $objFormParam->getHashArray(); | |
$wheres = $this->createWhere($objFormParam, $objDb); | |
$this->tpl_linemax = $this->getLineCount($wheres, $objProduct); | |
//ぶった斬りポイント================================================================== | |
// ページ送りの処理 |
<?php | |
namespace Plugin\HogePlugin; | |
use Eccube\Application; | |
use Symfony\Component\HttpKernel\Event\FilterResponseEvent; | |
class Event | |
{ | |
/** |
You can easily setup loanorleased if you are used to Docker. Please follow the link below.
NOTE: If you are new to Docker, you should not try it.
# EC-CUBEのHTTPポート番号 | |
#ECCUBE_HTTP_PORT= | |
# EC-CUBEのxdebug.remote_port | |
#ECCUBE_XDEBUG_PORT= | |
# EC-CUBEの設定 | |
#ECCUBE_APP_ENV= | |
#ECCUBE_APP_DEBUG= | |
#ECCUBE_DATABASE_URL= |
// 前略 | |
public function getRoles() | |
{return $this->getTraitRoles();} | |
//後略 |
<?php | |
namespace Customize\Common\Collections; | |
use Doctrine\Common\Collections\ArrayCollection; | |
use Doctrine\Common\Collections\Collection; | |
class DecorativeArrayCollection extends ArrayCollection | |
{ | |
public function __construct($elements = []) |