バージョン選択

フォーラム

メニュー

オンライン状況

37 人のユーザが現在オンラインです。 (24 人のユーザが フォーラム を参照しています。)
登録ユーザ: 0
ゲスト: 37
もっと...

サイト内検索

プラグイン > 開発について > 自作プラグインを有効化すると「名前は既に使用されているため、クラス を宣言できませんとエラーが出る」

開発について

新規スレッドを追加する

フラット表示 前のトピック | 次のトピック
投稿者 スレッド
yu86
投稿日時: 2024/4/4 17:14
対応状況: −−−
半人前
登録日: 2024/3/28
居住地:
投稿: 13
自作プラグインを有効化すると「名前は既に使用されているため、クラス を宣言できませんとエラーが出る」
▼テンプレート
[EC-CUBE] 4.2.0 さくらサーバーのクイックインストール
[レンタルサーバ] さくらのレンタルサーバー
[OS] Windows11
[PHP] 8.3.2
[データベース] DB名:masatomiplan_management、MySQL5.7
[WEBサーバ] WEBサーバ名:/home/masatomiplan/www
[ブラウザ] GoogleCrome123.0.6312.59
[導入プラグインの有無] なし(初期プラグインも削除済み)
[カスタマイズの有無] 管理項目からindex.twigを修正
            商品詳細の商品情報を修正
            問い合わせフォームの修正
            sodiumをインストール
[現象]下記サイトを参考にプラグインをインストール
https://umebius.com/eccube/v4-plugin-order_list_filter_shipping_date/

下記サイトの通りにコードをアップロード
https://jum11.com/2020/10/11/ec-cube4-product-search-customize/

SearchProductTypeExtension.phpでエラーが発生したので追記(コードの全文は後で添付いたします)

「コンパイル エラー: 名前は既に使用されているため、クラス Plugin\ProductSearchCustomize\Form\Extension\Admin\SearchProductExtension を宣言できません」とエラーが出る(今ここ)

私の方でも関数名を「SearchProductTypeShippingDateExtension」に変えるなどの対応を行いましたが、
また別のエラー(Expected to find class "Customize\Form\Type\Extension\SearchProductTypeExtension" in file "/home/masatomiplan/www/Management/app/Customize/Form/Type/Extension/SearchProductTypeExtension.php" while importing services from resource "../../../app/Customize/*", but it was not found! Check the namespace prefix used with the resource in /home/masatomiplan/www/Management/app/config/eccube/services.yaml (which is loaded in resource "/home/masatomiplan/www/Management/app/config/eccube/services.yaml").)が発生するだけでした。

正直私の手には負えないので皆様のお力添えをいただきたいです。
お忙しいところ恐れ入りますが何卒ご協力をお願いいたします。

エラーが発生しているコード全文
<?php

namespace Plugin\ProductSearchCustomize\Form\Extension\Admin;

use Eccube\Form\Type\PriceType;
use Symfony\Component\Form\AbstractTypeExtension;
use Symfony\Component\Form\FormBuilderInterface;
use Eccube\Form\Type\Admin\SearchProductType;

class SearchProductExtension extends AbstractTypeExtension
{
/**
* {@inheritdoc}
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('lower_price', PriceType::class, [
'required' => false,
])->add('upper_price', PriceType::class, [
'required' => false,
]);
}

/**
* {@inheritdoc}
*
* @return string
*/

public function getExtendedType()
{
return SearchOrderType::class;
}

public static function getExtendedTypes(): iterable
{
return [SearchProductType::class];
}
}
フラット表示 前のトピック | 次のトピック


題名 投稿者 日時
 » 自作プラグインを有効化すると「名前は既に使用されているため、クラス を宣言できませんとエラーが出る」 yu86 2024/4/4 17:14
     Re: 自作プラグインを有効化すると「名前は既に使用されているため、クラス を宣言できませんとエラーが出る」 tattsu 2024/4/4 17:21
       Re: 自作プラグインを有効化すると「名前は既に使用されているため、クラス を宣言できませんとエラーが出る」 yu86 2024/4/4 18:00
         Re: 自作プラグインを有効化すると「名前は既に使用されているため、クラス を宣言できませんとエラーが出る」 tattsu 2024/4/4 18:14
           自作プラグインを有効化するとPlugin\ProductSearchCustomize(プラグイン名)\Repository\ConfigRepository」をオートワイヤできませんとエラーが出る yu86 2024/4/5 9:16
             Re: 自作プラグインを有効化するとPlugin\ProductSearchCustomize(プラグイン名)\Repository\ConfigRepository」をオートワイヤできませんとエラーが出る tattsu 2024/4/5 9:34
               Re: 自作プラグインを有効化するとPlugin\ProductSearchCustomize(プラグイン名)\Repository\ConfigRepository」をオートワイヤできませんとエラーが出る yu86 2024/4/5 9:51
                 Re: 自作プラグインを有効化するとPlugin\ProductSearchCustomize(プラグイン名)\Repository\ConfigRepository」をオートワイヤできませんとエラーが出る tattsu 2024/4/5 9:58
                   Re: 自作プラグインを有効化するとPlugin\ProductSearchCustomize(プラグイン名)\Repository\ConfigRepository」をオートワイヤできませんとエラーが出る yu86 2024/4/5 10:36
                     Re: 自作プラグインを有効化するとPlugin\ProductSearchCustomize(プラグイン名)\Repository\ConfigRepository」をオートワイヤできませんとエラーが出る tattsu 2024/4/5 12:19
                       Re: 自作プラグインを有効化するとPlugin\ProductSearchCustomize(プラグイン名)\Repository\ConfigRepository」をオートワイヤできませんとエラーが出る yu86 2024/4/5 13:25
                         Re: 自作プラグインを有効化するとPlugin\ProductSearchCustomize(プラグイン名)\Repository\ConfigRepository」をオートワイヤできませんとエラーが出る tattsu 2024/4/5 13:36
                           Re: 自作プラグインを有効化するとPlugin\ProductSearchCustomize(プラグイン名)\Repository\ConfigRepository」をオートワイヤできませんとエラーが出る yu86 2024/4/5 15:31

 



ログイン


EC-CUBE公式 Amazon Payプラグイン

統計情報

総メンバー数は89,440名です
総投稿数は110,090件です

投稿数ランキング

1
seasoft
7367
2
468
3217
3
AMUAMU
2712
4
nanasess
2314
5
umebius
2085
6
yuh
1819
7
h_tanaka
1653
8
red
1570
9
mcontact
1305
10
tsuji
958
11
fukap
907
12
shutta
835
13
tao_s
799
14 ramrun 789
15 karin 689
16 sumida 641
17
homan
633
18 DELIGHT 572
19
patapata
502
20
flealog
485


ネットショップの壺

EC-CUBEインテグレートパートナー

Copyright© EC-CUBE CO.,LTD. All Rights Reserved.