0

Ecwid ショッピング カートを使用していますが、ラジオ ボタンがオンになっているかどうかに基づいて、製品の一部のオプションを非表示/表示したいと考えています。

私のテスト製品はここにあります:

http://www.farmboutique.com/testproduct1.html#!/~/product/category=5128132&id=21349373

javascript を使用してページをロードする際の選択の一部を非表示にしました。

誰かがラジオボタンをクリックしたときに、非表示の選択を表示したいと思います:

はい (9cm x 9cm 以内) (+£4.50)

「刺繍ロゴが必要ですか」オプションの下。

ページのロード時には、デフォルト値の「不要」が常に選択されます。

同様に、ページが読み込まれた後に誰かが [はい] オプションをクリックしてから、[不要] を選択して気が変わった場合、他のオプションは再び表示されなくなります。

「はい (9cm x 9cm 以下) (+£4.50)」および「不要」のラジオ ボタンの HTML コードは次のとおりです。

    <div id="ecwid-productoption-21349373-Do_You_Require_An_Embroidered_Logo-container" class="ecwid-productBrowser-details-optionPanel ecwid-productBrowser-details-optionPanel-radio ecwid-productoption-Do_You_Require_An_Embroidered_Logo-container">

    <label class="ecwid-fieldLabel" for="gwt-uid-5">Do You Require An Embroidere​d Logo</label>

    <div id="gwt-uid-5"><span class="gwt-RadioButton ecwid-productBrowser-details-optionRadioButton ecwid-productoption-Do_You_Require_An_Embroidered_Logo-Yes_:0028no_more_than_9cm_x_9cm:0029" id="ecwid-productoption-21349373-Do_You_Require_An_Embroidered_Logo-Yes_:0028no_more_than_9cm_x_9cm:0029">

    <input type="radio" name="21349373-Do You Require An Embroidered Logo" value="on" id="gwt-uid-3" tabindex="0">

    <label for="gwt-uid-3"><span class="ecwid-productBrowser-details-optionRadioButton-name">Yes (no more than 9cm x 9cm)</span>

    <span class="ecwid-productBrowser-details-optionRadioButton-price"> <span class="ecwid-productBrowser-details-optionRadioButton-bracket">(</span>

    <span class="ecwid-productBrowser-details-optionRadioButton-sign">+</span>

    <span>£</span>4.50<span class="ecwid-productBrowser-details-optionRadioButton-bracket">)</span></span></label></span>

    <span class="gwt-RadioButton ecwid-productBrowser-details-optionRadioButton ecwid-productoption-Do_You_Require_An_Embroidered_Logo-Not_Required" id="ecwid-productoption-21349373-Do_You_Require_An_Embroidered_Logo-Not_Required">

<input type="radio" name="21349373-Do You Require An Embroidered Logo" value="on" id="gwt-uid-4" tabindex="0" checked="">

<label for="gwt-uid-4"><span class="ecwid-productBrowser-details-optionRadioButton-name">Not Required</span></label></span></div></div>

上記の 21349373 は商品 ID = page.productId

4

1 に答える 1