runeveryday Posted June 8, 2012 Share Posted June 8, 2012 the default html output: <li class="clearfix"> <div class="input-box input-firstname input-select-box"> <label for="billing:firstname">First Name<span class="required">*</span></label> <input type="text" value="" id="billing:firstname" name="billing[firstname]" class="required-entry input-text"> </div> <div class="input-box input-lastname input-select-box"> <label for="billing:lastname">Last Name <span class="required">*</span></label> <input type="text" value="" id="billing:lastname" name="billing[lastname]" class="required-entry input-text"> </div></li> <li class="clearfix"> <div class="input-box input-country">...</div></li> <li class="clearfix"> <div class="input-box input-city input-select-box"> <label for="billing:city">City <span class="required">*</span></label> <input type="text" id="billing:city" class="required-entry input-text" title="City" value="" name="billing[city]"> </div></li> the php code: $billingFields['firstname'] = ' <div class="input-box input-firstname'.((in_array('firstname', $formErrors)) ? ' input-error' : '').'"> <label for="billing:firstname">'.$this->__('First Name').'<span class="required">*</span></label> <input class="required-entry input-text" type="text" name="billing[firstname]" id="billing:firstname" value="'.$this->getFirstname().'" /> </div>'; $billingFields['lastname'] = ' <div class="input-box input-lastname'.((in_array('lastname', $formErrors)) ? ' input-error' : '').'"> <label for="billing:lastname">'.$this->__('Last Name').' <span class="required">*</span></label> <input class="required-entry input-text" type="text" name="billing[lastname]" id="billing:lastname" value="'.$this->getLastname().'" /> </div>'; ?> <?php if(!$this->settings['exclude_country_id']):?> <?php $billingFields['country_id'] = ' <div class="input-box input-country'.((in_array('country', $formErrors)) ? ' input-error' : '').'"> <label for="billing:country_id">'.$this->__('Country').' <span class="required">*</span></label> '.$this->getCountryHtmlSelect('billing').' </div>'; ?> <?php else: ?> <?php $billingFields['country_id'] = ' <input type="hidden" name="billing[country_id]" id="billing:country_id" value="'.$this->settings['default_country'].'" />'; ?> <?php endif; ?> <?php if(!$this->settings['exclude_city']):?> <?php $billingFields['city'] = ' <div class="input-box input-city'.((in_array('city', $formErrors)) ? ' input-error' : '').'"> <label for="billing:city">'.$this->__('City').' <span class="required">*</span></label> <input type="text" name="billing[city]" value="'.$this->htmlEscape($this->getCity()).'" title="'.$this->__('City').'" class="required-entry input-text" id="billing:city" /> </div>'; ?> <?php endif; ?> <?php $billingFields = $this->getBillingFieldsOrder($billingFields);?> <?php foreach($billingFields as $key => $value):?> <?php if(!empty($value['has_li'])):?> <?php echo implode('',$value['fields']);?> <?php else:?> <li class="clearfix"><?php echo implode('',$value['fields']);?> <?php endif;?> <?php endforeach;?> i am sorry . i see the foreach loop. and feel all the code is the same, don't know how to alter it to output the country and city part in the same li like the firstname and lastname. <li class="clearfix">...</li> Quote Link to comment https://forums.phpfreaks.com/topic/263854-how-to-change-the-loop-to-echo-the-country-part-and-city-part-in-one-li/ 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.