Search Results

Search found 102 results on 5 pages for 'alaska airlines'.

Page 5/5 | < Previous Page | 1 2 3 4 5 

  • Customer Attribute, not sorting select options

    - by Bosworth99
    Made a module that creates some customer EAV attributes. One of these attributes is a Select, and I'm dropping a bunch of options into their respective tables. Everything lines up and is accessible on both the front end and the back. Last thing before calling this part of things finished is the sort order of the options. They come out all scrambled, instead of the obvious default or alphabetical (seemingly at random... very wierd). I'm on Mage v1.11 (Pro/Enterprise). config.xml <config> <modules> <WACI_CustomerAttr> <version>0.1.0</version> </WACI_CustomerAttr> </modules> <global> <resources> <customerattr_setup> <setup> <module>WACI_CustomerAttr</module> <class>Mage_Customer_Model_Entity_Setup</class> </setup> <connection> <use>core_setup</use> </connection> </customerattr_setup> </resources> <models> <WACI_CustomerAttr> <class>WACI_CustomerAttr_Model</class> </WACI_CustomerAttr> </models> <fieldsets> <customer_account> <agency><create>1</create><update>1</update></agency> <title><create>1</create><update>1</update></title> <phone><create>1</create><update>1</update></phone> <mailing_address><create>1</create><update>1</update></mailing_address> <city><create>1</create><update>1</update></city> <state><create>1</create><update>1</update></state> <zip><create>1</create><update>1</update></zip> <fed_id><create>1</create><update>1</update></fed_id> <ubi><create>1</create><update>1</update></ubi> </customer_account> </fieldsets> </global> </config> mysql4-install-0.1.0.php <?php Mage::log('Installing WACI_CustomerAttr'); echo 'Running Upgrade: '.get_class($this)."\n <br /> \n"; //die ( 'its running' ); $installer = $this; /* @var $installer Mage_Customer_Model_Entity_Setup */ $installer->startSetup(); // bunch of attributes // State $installer->addAttribute('customer','state', array( 'type' => 'varchar', 'group' => 'Default', 'label' => 'State', 'input' => 'select', 'default' => 'Washington', 'source' => 'WACI_CustomerAttr/customer_attribute_data_select', 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE, 'required' => true, 'visible' => true, 'user_defined' => 1, 'position' => 67 ) ); $attrS = Mage::getSingleton('eav/config')->getAttribute('customer', 'state'); $attrS->addData(array('sort_order'=>67)); $attrS->setData('used_in_forms', array('adminhtml_customer','customer_account_edit','customer_account_create'))->save(); $state_list = array('Alabama','Alaska','Arizona','Arkansas','California','Colorado','Connecticut','Delaware','Florida','Georgia', 'Hawaii','Idaho','Illinois','Indiana','Iowa','Kansas','Kentucky','Louisiana','Maine','Maryland','Massachusetts','Michigan', 'Minnesota','Mississippi','Missouri','Montana','Nebraska','Nevada','New Hampshire','New Jersey','New Mexico','New York', 'North Carolina','North Dakota','Ohio','Oklahoma','Oregon','Pennsylvania','Rhode Island','South Carolina','South Dakota', 'Tennessee','Texas','Utah','Vermont','Virginia','Washington','West Virginia','Wisconsin','Wyoming'); $aOption = array(); $aOption['attribute_id'] = $installer->getAttributeId('customer', 'state'); for($iCount=0;$iCount<sizeof($state_list);$iCount++){ $aOption['value']['option'.$iCount][0] = $state_list[$iCount]; } $installer->addAttributeOption($aOption); // a few more $installer->endSetup(); app/code/local/WACI/CustomerAttr/Model/Customer/Attribute/Data/Select.php <?php class WACI_CustomerAttr_Model_Customer_Attribute_Data_Select extends Mage_Eav_Model_Entity_Attribute_Source_Abstract{ function getAllOptions(){ if (is_null($this->_options)) { $this->_options = Mage::getResourceModel('eav/entity_attribute_option_collection') ->setAttributeFilter($this->getAttribute()->getId()) ->setStoreFilter($this->getAttribute()->getStoreId()) ->setPositionOrder('asc') ->load() ->toOptionArray(); } $options = $this->_options; return $options; } } theme/variation/template/persistent/customer/form/register.phtml <li> <?php $attribute = Mage::getModel('eav/config')->getAttribute('customer','state'); ?> <label for="state" class="<?php if($attribute->getIsRequired() == true){?>required<?php } ?>"><?php if($attribute->getIsRequired() == true){?><em>*</em><?php } ?><?php echo $this->__('State') ?></label> <div class="input-box"> <select name="state" id="state" class="<?php if($attribute->getIsRequired() == true){?>required-entry<?php } ?>"> <?php $options = $attribute->getSource()->getAllOptions(); foreach($options as $option){ ?> <option value='<?php echo $option['value']?>' <?php if($this->getFormData()->getState() == $option['value']){ echo 'selected="selected"';}?>><?php echo $this->__($option['label'])?></option> <?php } ?> </select> </div> </li> All options are getting loaded into table eav_attribute_option just fine (albeit without a sort_order defined), as well as table eav_attribute_option_value. In the adminhtml / customer-manage customers-account information this select is showing up fine (but its delivered automatically by the system). Seems I should be able to set the sort-order on creation of the attributeOptions, or, certainly, define the sort order in the data/select class. But nothing I've tried works. I'd rather not do a front-end hack either... Oh, and how do I set the default value of this select? (Different question, I know, but related). Setting the attributes 'default' = 'washington' seems to do nothing. There seem to be a lot of ways to set up attribute select options like this. Is there a better way that the one I've outlined here? Perhaps I'm messing something up. Cheers

    Read the article

  • How to Submit Form Given Specific Json Response

    - by dentalhero
    I'm new to Json, so please excuse the newb question. I have a form in which I'm conducting an Ajax post to submit address information to a backend script for validation. Here's the form: <form name="Form" id="Forms" method="post" action="WebCatPageServer.exe" class="uniForm"> <input name="Action" type="hidden" value="SHIPTOVALIDATE"/> <input name="IsAjax" type="hidden" value="Yes"/> <!-- <input name="Action" type="hidden" value="VerifyOrder"/>--> <fieldset class="inlineLabels top"> <h2>Order Details</h2> <div class="ctrlHolder first"> <label for="orderdesc">Order Description</label> <input name="Order Desc" id="OrderDesc" type="text" class="textInput small" tabindex="1" value=""/> </div> <div class="ctrlHolder"> <label for="po">PO # <span class="redasterisk">*</span></label> <input name="Cust Po" id="PoJobNo" type="text" class="textInput small required" maxlength="20" tabindex="2" value="dgnfg"/> </div> <!-- <div class="ctrlHolder"> <label for="jobname">Job Name</label> <input name="Job Name" id="CustJobName" type="text" class="textInput small" maxlength="15" tabindex="3" value=""/> </div> --> <div class="ctrlHolder"> <label for="shipvia">Ship Via <span class="redasterisk">*</span></label> <select name="Ship Via" id="shipvia" class="selectInput small required" tabindex="4"/> <option value="" class="default">Select Ship Method</option> <option value="OT - Our Truck" class="del" selected>Our Truck</option> <option value="WC - Will Call" class="pick">Will Call</option> </select> </div> <div class="ctrlHolder" id="pickupdate"> <label for="datepickup">Requested Pickup Date <span class="redasterisk">*</span></label> <input name="datepickup" id="datepickup" type="text" class="textInput small" tabindex="5" value="11/09/2012"> </div> <div class="ctrlHolder" id="shipdate"> <label for="dateship">Requested Delivery Date <span class="redasterisk">*</span></label> <input name="dateship" id="dateship" type="text" class="textInput small" value="" tabindex="6"> </div> <div class="ctrlHolder" id="shipto"> <label for="ShipTo">Ship To <span class="redasterisk">*</span></label> <select name="ShipTos" id="ShipTos" class="selectInput auto required" tabindex="7"> <option value="">Select an Option</option> <option value="ShipToManual" class="manual">Manually Enter Address</option> <option value="0">A ACTION AIR*, 5241 YANCEYVILLE, COLUMBIA, SC 29214-0001</option> <option value="1">A ACTION AIR*, 649 spring lane, sanford, NC 27330</option> <option value="2">A ACTION AIR*, 1313 south briggs avenue, durham, NC 27703</option> <option value="3">A ACTION AIR*, 112 cricket hill lane, cary, NC 27513</option> <option value="4">A ACTION AIR*, 2911 duke homestead road, durham, NC 27705</option> <option value="5">A ACTION AIR*, chickem poop, atlanta, GA 60609</option> </select> <br /> </div> </fieldset> <fieldset class="inlineLabels" id="shipinfo"> <h2>Shipping Information</h2> <div class="ctrlHolder first"> <label for="YourName">Your Name <span class="redasterisk">*</span></label> <input name="Your Name" id="Your_Name" type="text" class="textInput small required" tabindex="8" value="" /> </div> <div class="ctrlHolder"> <label for="CompanyName">Company Name <span class="redasterisk">*</span></label> <input name="Company Name" id="CompanyName" type="text" class="textInput small required" tabindex="9" value="A ACTION AIR*"/> </div> <div class="ctrlHolder"> <label for="Address1">Address 1 <span class="redasterisk">*</span></label> <input name="Address_1" id="Address_1" type="text" maxlength="30" class="textInput small required" tabindex="10" value="5241 YANCEYVILLE"/> </div> <div class="ctrlHolder"> <label for="Address2">Address 2</label> <input name="Address_2" id="Address_2" type="text" maxlength="30" class="textInput small" tabindex="11" value=""/> </div> <div class="ctrlHolder"> <label for="City">City <span class="redasterisk">*</span></label> <input name="City" id="City" type="text" maxlength="25" class="textInput small required" tabindex="12" value="COLUMBIA"/> </div> <div class="ctrlHolder"> <label for="State">State <span class="redasterisk">*</span></label> <select name="State" id="State" class="selectInput small required" tabindex="13"> <option value="">Select State</option> <option value="AL">Alabama</option> <option value="AK">Alaska</option> <option value="AZ">Arizona</option> <option value="AR">Arkansas</option> <option value="CA">California</option> <option value="CO">Colorado</option> <option value="CT">Connecticut</option> <option value="DE">Delaware</option> <option value="FL">Florida</option> <option value="GA">Georgia</option> <option value="HI">Hawaii</option> <option value="ID">Idaho</option> <option value="IL">Illinois</option> <option value="IN">Indiana</option> <option value="IA">Iowa</option> <option value="KS">Kansas</option> <option value="KY">Kentucky</option> <option value="LA">Louisiana</option> <option value="ME">Maine</option> <option value="MD">Maryland</option> <option value="MA">Massachussetts</option> <option value="MI">Michigan</option> <option value="MN">Minnesota</option> <option value="MS">Mississippi</option> <option value="MO">Missouri</option> <option value="MT">Montana</option> <option value="NE">Nebraska</option> <option value="NV">Nevada</option> <option value="NH">New Hampshire</option> <option value="NJ">New Jersey</option> <option value="NM">New Mexico</option> <option value="NY">New York</option> <option value="NC">North Carolina</option> <option value="ND">North Dakota</option> <option value="OH">Ohio</option> <option value="OK">Oklahoma</option> <option value="OR">Oregon</option> <option value="PA">Pennsylvania</option> <option value="RI">Rhode Island</option> <option value="SC" selected>South Carolina</option> <option value="SD">South Dakota</option> <option value="TN">Tennessee</option> <option value="TX">Texas</option> <option value="UT">Utah</option> <option value="VT">Vermont</option> <option value="VA">Virginia</option> <option value="WA">Washington</option> <option value="WV">West Virginia</option> <option value="WI">Wisconsin</option> <option value="WY">Wyoming</option> </select> </div> <div class="ctrlHolder"> <label for="ZipCode">Zip Code <span class="redasterisk">*</span></label> <input name="Zip" id="Zip" type="text" maxlength="10" class="textInput small required zipcode" tabindex="14" value=""/> </div> <div class="ctrlHolder"> <label for="Phone">Phone <span class="redasterisk">*</span></label> <input name="Phone Number" id="Phone" type="text" class="textInput small required phone" alt="phone-us" tabindex="15" value="(336)954-5009"/> </div> <div class="ctrlHolder"> <label for="Fax">Fax</label> <input name="FaxNumber" id="Fax Number" type="text" class="textInput small fax" alt="phone-us" tabindex="16" value=""/> </div> <div class="ctrlHolder"> <label for="">E-mail <span class="redasterisk">*</span></label> <input name="Email" id="Email" type="text" class="textInput small required email" tabindex="17" value=""/> </div> </fieldset> <fieldset class="inlineLabels"> <h2>Order/Shipping Notes</h2> <div class="ctrlHolder first"> <label for="notes">Order Notes </label> <textarea name="OrderNotes" id="ta" cols="26" rows="7" tabindex="18"></textarea><br /> <p class="formHint"><b>(Maximum characters: 175) &nbsp; <span id="charLeft"></span> &nbsp; Characters left</b><br /> (Cross streets, special instructions, etc.)</p> <br /> </div> </fieldset> <fieldset class="inlineLabels"> <h2>Continue To Next Step</h2> <div class="buttonHolder"> <label for="freightmsg">**Applicable freight charges will be applied at the time of invoicing.**</label> <input name="continuetocheckout" type="submit" class="button red smallrounded" value="Continue &gt;" alt="Continue to Next Step" tabindex="20"/> </div> </fieldset> </form> AJAX Call Here's the AJAX call: $(function() { $("#Forms").submit(function() { $.ajax({ type: 'post', url: 'WebCatPageServer.exe', dataType : 'json', data: $("#Forms").serialize(), complete:function(data){ alert(data); } }); return false; }); }); JSON Response Here's the JSON response: {"DidValidate":true,"Company Name":"A ACTION AIR*","AddrLine1":"5241 YANCEYVILLE","AddrLine2":"","City":"COLUMBIA","State":"SC","Zip":"","Modified":false,"AddressError":false,"ZipError":false} Question: How do I submit the form programatically if both AddressError and ZipError return with a false?

    Read the article

< Previous Page | 1 2 3 4 5