<style>
    body{
        padding:30px;
    }
    .ul-content-list {
        /*display: flex;*/
    }
    .whmp_order_combo ul {
        height: 33px;
        background: #fff;
        list-style: none;
        margin: 0;
        width: 62%;
        min-width: 270px;
        position: relative;
        line-height: 23px;
        font-size: 14px;
        margin-bottom: 15px;
    }
    .whmp_order_combo ul li.init {
        text-align: center;
        border-radius: 4px;
        border: 1px solid #999;
    }
    .whmp_order_combo ul li {
        padding: 5px 10px; z-index: 2;
        color: #333333;
        border-left: 1px solid #999;
        border-right: 1px solid #999;
    }
    .whmp_order_combo ul li:last-child{
        border-bottom: 1px solid #999;
    }
    .whmp_order_combo ul li span{
        margin-left: 2px;
        padding: 0 8px;
        background: #fbce3b;
        border-radius: 10px;
        font-weight: 500;
    }
    .whmp_order_combo ul li:not(.init) { display: none; background: #fff}
    .whmp_order_combo ul li:not(.init):hover, .whmp_order_combo ul li.selected:not(.init) {
        color: rgba(38, 38, 38, 0.79);
        text-decoration: none;
        background-color: #f5f5f5; }
    li.init { cursor: pointer; }

</style>
<div class="whmp_order_combo">

    <form action="{$action_url}">

        <input type="hidden" value="add" name="a">
        <input type="hidden" value="{$pid}" name="pid">
        <input type="hidden" value="{$currency_id}" name="currency">
        <input type="hidden" value="" name="billingcycle" id="cob_billing">

        <div class="ul-content-list">

        <ul class="form-control">

            <li value="" class="init">Select Duration</li>
            {foreach from=$data item=whmp}

            <li data-billing = {$whmp.duration} value="{$whmp.duration}" data-value="billingcycle">{$whmp.duration} - {$whmp.prefix}{$whmp.amount}{$whmp.decimal}{$whmp.fraction} {$whmp.suffix} {if $whmp.discount} -<span>{$whmp.discount}%</span> {elseif $whmp.discount eq ''} - No Discount {/if}</li>

            {/foreach}

        </ul>

        {$product_order_button}
        </div>
    </form>

</div>
<script>
    var ul_handler = jQuery;

    //== Toggle ul options
    ul_handler(".whmp_order_combo ul").on("click", ".init", function() {
        ul_handler(this).closest(".whmp_order_combo ul").children('li:not(.init)').toggle();
    });

    //== Get all li options
    var allOptions = ul_handler(".whmp_order_combo ul").children('li:not(.init)');


    //== populate billincycle hidden field on click of li and make li selected
    ul_handler(".whmp_order_combo ul").on("click", "li:not(.init)", function() {
        document.getElementById('cob_billing').value = jQuery(this).data("billing");
        allOptions.removeClass('selected');
        jQuery(this).addClass('selected');
        jQuery(".whmp_order_combo ul").children('.init').html(jQuery(this).html());
        allOptions.toggle();
    });
</script>