Community Store - add more questions to checkout1 user found helpful
I am working community store package which is going great (great features, well done to all involved), I have one question though relating to the checkout:
How do I add two radio buttons to the checkout that will then get sent through with order confirmation? I have successfully inserted the following code and it displays correctly but I'm not sure how to get its responses sent through with the order confirmation to the admin
<h2><?= t("Other options") ?></h2> <div class="form-group"> <label><?= t('If a plant I have selected is unavailable:'); ?></label> <div class="radio"> <label> <input type="radio" name="OutofStockOptions" id="OutofStockOptions" value="Select a suitable substitute for me" checked>Select a suitable substitute for me </label> </div> <div class="radio"> <label> <input type="radio" name="OutofStockOptions" id="OutofStockOptions" value="Send the rest of my order and refund me for the missing plant">Send the rest of my order and refund me for the missing plant </label> </div> </div>
Any help would be greatly appreciated.
You have to create your order attribute then make sure it's in that particular 'Customer Choices' attribute group to appear. For a radio/select option, I had to go to Attribute Types (/index.php/dashboard/system/attributes/types) and configure it to be available to 'Store Order'.
This achieved what you are after when I tested it, but in the checkout it only showed a 1 or a 2 as the selected option, not the text I entered in as the choice. So you could either look into why that is happening, or potentially use a checkbox instead.
I have added a basic checkbox attribute via the order>attributes section, placed it in the "other customer choices" section but it doesn't appear. Looking at the checkout singlepage I can see the container but it is looking for a setting of orderChoicesEnabled which I have no idea where to enable.
From my quick test, I didn't have to do anything specific to make it appear, I just made sure the attribute was in that 'Other Customer Choices' set. Are you sure your new attribute has been successfully placed into that particular set?
Thank you so much!!!
I have just discovered your solution technically works in the checkout (even though as you pointed out it shows 1/0 for selections) however I have just found that it doesn't even show the 1 or 0 when you view the order details via the dashboard.
I was just hoping to confirm if you found the same thing?
Are you running the latest release, or the latest from the master branch?
I've just pushed up another release (v1.2.3) which includes all the recent minor bugfixes, including this one that is relevant: