ayaron Posted August 2, 2020 Share Posted August 2, 2020 Hi, I need to change the condition of presenting a drop down list instead of checkbox to be related to order amount in the cart, what do I change in the below condition? <?php if ( $this->Installments_field ) : ?> </p> <p class="form-row form-row-last"> <label for="offline_cc_Installments"><?php _e("Installments", 'wc_offline_cc') ?> <span class="required">*</span></label> <select name="offline_cc_Installments" id="offline_cc_Installments"> <option value="1"><?php _e('תשלום אחד', 'wc_offline_cc') ?></option> <option value="2"><?php _e('שני תשלומים', 'wc_offline_cc') ?></option> <option value="3"><?php _e('שלושה תשלומים', 'wc_offline_cc') ?></option> Quote Link to comment Share on other sites More sharing options...
requinix Posted August 2, 2020 Share Posted August 2, 2020 Do you know what the HTML markup is for checkboxes? Your drop down does not support multiple selections right now. Checkboxes do support multiple selections. Do you want that, and if so are you working on changing your PHP code to support that? Quote Link to comment Share on other sites More sharing options...
ayaron Posted August 3, 2020 Author Share Posted August 3, 2020 Hi Thank you for your reply, I don't need multiple selection the client allows to select only one option for how many installments he needs. I just want the list to be presented only at certain order mount, now if I want him to see the list I select the checkbox in my admin interface which in the "IF" condition in the above code. Yaron Quote Link to comment Share on other sites More sharing options...
requinix Posted August 3, 2020 Share Posted August 3, 2020 Checkboxes are for multiple selections. If you do not want multiple selections then do not use checkboxes. Use radio buttons instead. So I'll make a minor change to my first question and repeat it here: do you know what the HTML markup is for radio buttons? When you have that, all you have to do is drop the <select> tags and replace each <option> with a radio button. (And then probably a little more markup or styling to make the radio buttons appear the way you want.) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.