Rich Posted November 16, 2020 Posted November 16, 2020 I have more than one shipping method and would like to have the available methods shown as radio buttons (with the default method selected). This would show the customer all the choices without requiring them to pull down the dropdown to make their selection. I'm sure this topic has been discussed before but can't seem to find any example of the code changes required??? Has anyone done this and willing to share their solution?
fabriceunko Posted November 16, 2020 Posted November 16, 2020 I confirm this should be interesting, and could be an option in cubecart. Hopefully someone good looking posts a hack.
NiteFox Posted November 16, 2020 Posted November 16, 2020 Its do-able, as an example you could swap out the default html for the shipping section and use something like: (Layout/Files will vary depending on what skin you use) ** Example based on coding from Claudia M - https://forums.cubecart.com/topic/55954-radio-buttons-in-checkout/?tab=comments#comment-242431 <td colspan="4"> {if !isset($free_coupon_shipping)} <label><b>{$LANG.basket.shipping_select}:</b></label> <ul class="no-bullet left"> {foreach from=$SHIPPING key=group item=methods} <li><small><strong>{$group}</strong></small></li> {foreach from=$methods item=method} <li> <input name="shipping" type="radio" value="{$method.value}" id="{$method.value}" {$method.selected|replace:'selected':'checked'}><label for="{$method.value}">{$method.display}</label> </li> {/foreach} {/foreach} </ul> {/if} </td>
fabriceunko Posted November 16, 2020 Posted November 16, 2020 Interesting, but I do not see where to put your code .. you should know that I am very new in this manipulation, I use the foundation skin
NiteFox Posted November 16, 2020 Posted November 16, 2020 1 hour ago, fabriceunko said: Interesting, but I do not see where to put your code .. you should know that I am very new in this manipulation, I use the foundation skin For foundation based on the default skin you'd : Open foundation > templates > content.checkout.medium-up.php lines 47-64 find: <td colspan="4"> {if !isset($free_coupon_shipping)} {$LANG.basket.shipping_select}: <select name="shipping"> <option value="">{$LANG.form.please_select}</option> {foreach from=$SHIPPING key=group item=methods} {if $HIDE_OPTION_GROUPS ne '1'} <optgroup label="{$group}">{/if} {foreach from=$methods item=method} <option value="{$method.value}" {$method.selected}>{$method.display}</option> {/foreach} {if $HIDE_OPTION_GROUPS ne '1'} </optgroup> {/if} {/foreach} </select> {/if} </td> now replace it with : <td colspan="4"> {if !isset($free_coupon_shipping)} <label><b>{$LANG.basket.shipping_select}:</b></label> <ul class="no-bullet left"> {foreach from=$SHIPPING key=group item=methods} {if $HIDE_OPTION_GROUPS ne '1'}<li><small><strong>{$group}</strong></small></li>{/if} {foreach from=$methods item=method} <li> <input name="shipping" type="radio" value="{$method.value}" id="{$method.value}" {$method.selected|replace:'selected':'checked'}><label for="{$method.value}">{$method.display}</label> </li> {/foreach} {/foreach} </ul> {/if} </td> Open foundation > templates > content.checkout.small.php lines 86-100 find: {if !isset($free_coupon_shipping)} <select name="shipping" class="nomarg"> <option value="">{$LANG.form.please_select}</option> {foreach from=$SHIPPING key=group item=methods} {if $HIDE_OPTION_GROUPS ne '1'} <optgroup label="{$group}">{/if} {foreach from=$methods item=method} <option value="{$method.value}" {$method.selected}>{$method.display}</option> {/foreach} {if $HIDE_OPTION_GROUPS ne '1'} </optgroup> {/if} {/foreach} </select> {/if} Now replace it with: {if !isset($free_coupon_shipping)} <ul class="no-bullet left"> {foreach from=$SHIPPING key=group item=methods} {if $HIDE_OPTION_GROUPS ne '1'}<li><small><strong>{$group}</strong></small></li>{/if} {foreach from=$methods item=method} <li> <input name="shipping" type="radio" value="{$method.value}" id="{$method.value}" {$method.selected|replace:'selected':'checked'}><label for="{$method.value}">{$method.display}</label> </li> {/foreach} {/foreach} </ul> {/if} Save and clear site cache to see results.
Rich Posted November 16, 2020 Author Posted November 16, 2020 NiteFox beat me to it! But the solution works great. Thanks!!!
fabriceunko Posted November 16, 2020 Posted November 16, 2020 Thanks Nitfox. I offer you a beer for sharing .. thank you again ..
dravenwalker Posted September 15, 2022 Posted September 15, 2022 Great knowledge it helped me to have a radio collection you can see here: https://radiofmluisteren.nl/
Recommended Posts
Archived
This topic is now archived and is closed to further replies.