0

I am using an extension called JTickets to manage payments in Jomsocial events, I would like to change a fields default selection from limited seats to unlimited seats, code is as follows:-

$unlimited_seats_options[] = JHtml::_('select.option', 1, JText::_('COM_JTICKETING_UNLIMITED_SEATS_YES'));
$unlimited_seats_options[] = JHtml::_('select.option', 0, JText::_('COM_JTICKETING_UNLIMITED_SEATS_NO'));


      <!--ticket_type_unlimited Seats-->
       <div class="form-group  jticketing-form-group" >
          <div class="jticketing-controls col-lg-10 col-md-10 col-sm-9 col-xs-12 col-lg-offset-2 col-md-offset-2 col-sm-offset-3 jt-input-text">
             <div class="">
                <?php
                   if ($tickettype->unlimited_seats)
                   {
                       $avalaible_class="ticket_type_available_field_hide";

                    echo JHtml::_('select.genericlist', $unlimited_seats_options, "ticket_type_unlimited_seats[]", 'class="chzn-done jticket_access" onchange="togglefield(this,\'ticket_type_available_field\')" data-chosen="com_jticketing"', "value", "text", $tickettype->unlimited_seats,"ticket_type_unlimited_seats_".$j);
                   }
                   else
                   {
                        $avalaible_class="";
                        echo JHtml::_('select.genericlist', $unlimited_seats_options, "ticket_type_unlimited_seats[]", 'class="chzn-done jticket_access" onchange="togglefield(this,\'ticket_type_available_field\')" data-chosen="com_jticketing"', "value", "text",0,"ticket_type_unlimited_seats_".$j);

                   }
                   ?>
             </div>
          </div>
       </div>
       <!--ticket_type_unlimited Seats DIV ENDS-->

currently drop down menu is set to limited seat, i would like to set default value to unlimited seats

1 Answer 1

1

Either you need to have

$tickettype->unlimited_seats = 1;

or just

echo JHtml::_('select.genericlist', $unlimited_seats_options, "ticket_type_unlimited_seats[]", 'class="chzn-done jticket_access" onchange="togglefield(this,\'ticket_type_available_field\')" data-chosen="com_jticketing"', "value", "text", 1,"ticket_type_unlimited_seats_".$j);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.