[EC-CUBE]4.1.2-p1 アップデート
[レンタルサーバ] Xサーバー
[OS] Linux sv32.sixcore.ne.jp 4.4.0-251-generic #285-Ubuntu SMP Fri Feb 2 23:04:19 UTC 2024 x86_64
[PHP] 7.4.33
[データベース] MySQL 5.7.32
[WEBサーバ] Apache
[ブラウザ] chrome
[導入プラグインの有無] 最短お届け日調整プラグイン(DeliveryDate4)
[カスタマイズの有無] 配送先の郵便番号によって送料を変更するカスタマイズ有
[現象] 購入画面の配送方法のプルダウンリストをラジオボタンに変更したいが、expandedをtrueにする指示を入れても反映されない
掲示板をご覧いただきありがとうございます。
購入画面の配送方法のプルダウンリストをラジオボタンに変更したいと思い、下記の内容でphpをアップロードしたのですが、デバッグモードで確認してもexpandedの変更が反映されずエラーも出ていません。
キャッシュの削除も試しましたが、変化はありませんでした。
下記のソース内に間違いはありますか?
ShippingTypeExtension.phpのソース
<?php
namespace Customize\Form\Extension\Shopping;
use Eccube\Form\Type\Shopping\ShippingType;
use Eccube\Common\EccubeConfig;
use Eccube\Entity\Delivery;
use Eccube\Entity\Shipping;
use Symfony\Component\Form\AbstractTypeExtension;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\OptionsResolver\OptionsResolver;
class ShippingTypeExtension extends AbstractTypeExtension
{
/**
* {@inheritdoc}
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
// 配送方法をラジオボタンに変更.
$builder->add('Delivery', EntityType::class, [
'class' => Delivery::class,
'choice_label' => 'name',
'expanded' => true,
'multiple' => false,
]);
}
/**
* {@inheritdoc}
*/
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'data_class' => 'Eccube\Entity\Shipping',
]);
}
/**
* {@inheritdoc}
*/
public function getExtendedType()
{
return ShippingType::class;
}
/**
* {@inheritdoc}
*/
public static function getExtendedTypes(): iterable
{
return [ShippingType::class];
}
}
twigの該当部分のソース
前略
<div class="ec-orderDelivery__actions">
<div class="ec-selects">
<div class="ec-select">
<label>{{ '配送方法'|trans }}</label>
{{ form_widget(form.Shippings[idx].Delivery, { 'attr': { 'class': 'form-control', 'data-trigger': 'change' }}) }}
{{ form_errors(form.Shippings[idx].Delivery) }}
</div>
<div class="ec-select ec-select__delivery">
<label>{{ 'お届け日'|trans }}</label>
{{ form_widget(form.Shippings[idx].shipping_delivery_date, {'attr': {'class': 'form-control'}}) }}
{{ form_errors(form.Shippings[idx].shipping_delivery_date) }}
</div>
<div class="ec-select ec-select__time">
<label>{{ 'お届け時間'|trans }}</label>
{{ form_widget(form.Shippings[idx].DeliveryTime, {'attr': {'class': 'form-control'}}) }}
{{ form_errors(form.Shippings[idx].DeliveryTime) }}
</div>
</div>
</div>
後略
よろしくお願いします。