influxweb
4/27/2017 - 9:29 PM

Updated Customer Fields for Base/Bootstrap ReadyTheme ACED Page

Updated Customer Fields for Base/Bootstrap ReadyTheme ACED Page

<div id="fields-key">
	<div><strong>Bold</strong> = Required</div>
	<div><em>Italic</em> = Optional</div>
	<mvt:if expr="( g.UI_Exception EQ 1 ) AND ( ( g.Session:cache:last_ui_exception EQ 'order_invalid_info' ) OR ( g.Session:cache:last_ui_exception EQ 'customer_invalid_addinfo' ) OR ( g.Session:cache:last_ui_exception EQ 'customer_invalid_editinfo' ) )">   
		<div><span class="red">Red</span> = Invalid</div>
	</mvt:if>
</div>
<input type="hidden" name="Customer_Login" value="&mvte:global:Customer:login;" />
<input type="hidden" name="Customer_PasswordEmail" value="&mvte:global:Customer:pw_email;" />
<br />
<div id="ship-to" class="col-md-6">
	<h2 class="fields-heading">
		Ship To:
	<mvt:comment>
		<mvt:if expr="g.Action AND g.shipping_to_show">
			<label for="shipping_to_show" id="shipping_controls" class="controls input-sm"><input name="shipping_to_show" id="shipping_to_show" type="checkbox" value="1" checked /> same as billing</label>
		<mvt:else>
			<label for="shipping_to_show" id="shipping_controls" class="controls input-sm"><input name="shipping_to_show" id="shipping_to_show" type="checkbox" value="1" /> same as billing</label>
		</mvt:if>
	</mvt:comment>
	</h2>
	<div id="shipping_fields">
<mvt:if expr="g.Basket:cust_id AND g.Customer_Session_Verified">
            <div class="&mvte:global:ShipID_Row;">
                <label class="required" for="Customer_ShipID">Saved Address:</label>
                <select name="Customer_ShipID" id="shipping_selector">
                    <option value="-1">&lt;New&gt;</option>
                    <mvt:foreach iterator="address" array="customer:addresses">
                        <mvt:if expr="toupper( l.settings:address:fname ) EQ toupper( g.Customer_ShipFirstName ) AND
                                         toupper( l.settings:address:lname ) EQ toupper( g.Customer_ShipLastName ) AND
                                         toupper( l.settings:address:email ) EQ toupper( g.Customer_ShipEmail ) AND
                                         toupper( l.settings:address:comp ) EQ toupper( g.Customer_ShipCompany ) AND
                                         toupper( l.settings:address:phone ) EQ toupper( g.Customer_ShipPhone ) AND
                                         toupper( l.settings:address:fax ) EQ toupper( g.Customer_ShipFax ) AND
                                         toupper( l.settings:address:addr1 ) EQ toupper( g.Customer_ShipAddress1 ) AND
                                         toupper( l.settings:address:addr2 ) EQ toupper( g.Customer_ShipAddress2 ) AND
                                         toupper( l.settings:address:city ) EQ toupper( g.Customer_ShipCity ) AND
                                         (
                                            ( ( NOT ISNULL g.Customer_ShipStateSelect ) AND ( toupper( l.settings:address:state ) EQ toupper( g.Customer_ShipStateSelect ) ) ) OR
                                            ( ( ISNULL g.Customer_ShipStateSelect ) AND ( toupper( l.settings:address:state ) EQ toupper( g.Customer_ShipState ) ) )
                                         ) AND
                                         toupper( l.settings:address:zip ) EQ toupper( g.Customer_ShipZip ) AND
                                         toupper( l.settings:address:cntry ) EQ toupper( g.Customer_ShipCountry )">
                            <option value="&mvte:address:id;" selected>&mvte:address:descrip;</option>
                        <mvt:else>
                            <option value="&mvte:address:id;">&mvte:address:descrip;</option>
                        </mvt:if>
                    </mvt:foreach>
                </select>
            </div>
        </mvt:if>
		<div class="&mvte:global:ShipFirstName_Row;">
			<label class="control-label required" for="Customer_ShipFirstName">First Name:</label>
			<input type="text" name="Customer_ShipFirstName" id="Customer_ShipFirstName" value="&mvte:global:Customer_ShipFirstName;" class="form-control" />
		</div>
		<div class="&mvte:global:ShipLastName_Row;">
			<label class="control-label required" for="Customer_ShipLastName">Last Name:</label>
			<input type="text" name="Customer_ShipLastName" id="Customer_ShipLastName" value="&mvte:global:Customer_ShipLastName;" class="form-control" />
		</div>
		<div class="&mvte:global:ShipEmail_Row;">
			<label class="control-label required" for="Customer_ShipEmail">Email Address:</label>
			<input type="text" name="Customer_ShipEmail" id="Customer_ShipEmail" value="&mvte:global:Customer_ShipEmail;" class="form-control" />
		</div>
		<div class="&mvte:global:ShipPhone_Row;">
			<label class="control-label required" for="Customer_ShipPhone">Phone Number:</label>
			<input type="text" name="Customer_ShipPhone" id="Customer_ShipPhone" value="&mvte:global:Customer_ShipPhone;" class="form-control" />
		</div>
		<div class="&mvte:global:ShipFax_Row;">
			<label class="control-label italic" for="Customer_ShipFax">Fax Number:</label>
			<input type="text" name="Customer_ShipFax" id="Customer_ShipFax" value="&mvte:global:Customer_ShipFax;" class="form-control" />
		</div>
		<div class="&mvte:global:ShipCompany_Row;">
			<label class="control-label italic" for="Customer_ShipCompany">Company:</label>
			<input type="text" name="Customer_ShipCompany" id="Customer_ShipCompany" value="&mvte:global:Customer_ShipCompany;" class="form-control" />
		</div>
		<div class="&mvte:global:ShipAddress1_Row;">
			<label class="control-label required" for="Customer_ShipAddress1">Address:</label>
			<input type="text" name="Customer_ShipAddress1" id="Customer_ShipAddress1" value="&mvte:global:Customer_ShipAddress1;" class="form-control" />
		</div>
		<div class="&mvte:global:ShipAddress2_Row;">
			<label class="control-label italic" for="Customer_ShipAddress2">Address 2:</label>
			<input type="text" name="Customer_ShipAddress2" id="Customer_ShipAddress2" value="&mvte:global:Customer_ShipAddress2;" class="form-control" />
		</div>
		<div class="&mvte:global:ShipCity_Row;">
			<label class="control-label required" for="Customer_ShipCity">City:</label>
			<input type="text" name="Customer_ShipCity" id="Customer_ShipCity" value="&mvte:global:Customer_ShipCity;" class="form-control" />
		</div>
		<mvt:if expr="g.States_Empty">
			<div class="&mvte:global:ShipState_Row;">
				<label class="control-label required" for="Customer_ShipState">State:</label>
				<input type="text" name="Customer_ShipState" id="Customer_ShipState" value="&mvte:global:Customer_ShipState;" class="form-control" />
			</div>
			<mvt:else>
			<div class="&mvte:global:ShipState_Row;">
				<label class="control-label required" for="Customer_ShipStateSelect">State:</label>
				<mvt:item name="states" param="Customer_ShipStateSelect" />
			</div>
			<div class="&mvte:global:ShipState_Row;">
				<label class="control-label italic" for="Customer_ShipState">Other State/Province:</label>
				<input type="text" name="Customer_ShipState" id="Customer_ShipState" value="&mvte:global:Customer_ShipState;" class="form-control">
			</div>
		</mvt:if>
		<div class="&mvte:global:ShipZip_Row;">
			<label class="control-label required" for="Customer_ShipZip">Zip:</label>
			<input type="text" name="Customer_ShipZip" id="Customer_ShipZip" value="&mvte:global:Customer_ShipZip;" class="form-control" />
		</div>
		<div class="&mvte:global:ShipCountry_Row;">
			<label class="control-label required" for="Customer_ShipCountry">Country:</label>
			<mvt:item name="countries" param="Customer_ShipCountry" />
		</div>
	</div>
</div>
<div id="bill-to" class="col-md-6">
	<h2 class="fields-heading">
		Bill To:
		<mvt:if expr="g.Action AND g.billing_to_show">
			<label for="billing_to_show" id="billing_controls" class="controls input-sm"><input name="billing_to_show" id="billing_to_show" type="checkbox" value="1" checked /> same as shipping</label>
		<mvt:else>
			<label for="billing_to_show" id="billing_controls" class="controls input-sm"><input name="billing_to_show" id="billing_to_show" type="checkbox" value="1" /> same as shipping</label>
		</mvt:if>
	</h2>
	<div id="billing_fields">
<mvt:if expr="g.Basket:cust_id AND g.Customer_Session_Verified">
	            <div class="&mvte:global:BillID_Row;">
	                <label class="required" for="Customer_BillID">Saved Address:</label>
	                <select name="Customer_BillID" id="billing_selector">
	                    <option value="-1">&lt;New&gt;</option>
	                    <mvt:foreach iterator="address" array="customer:addresses">
	                        <mvt:if expr="toupper( l.settings:address:fname ) EQ toupper( g.Customer_BillFirstName ) AND
	                                         toupper( l.settings:address:lname ) EQ toupper( g.Customer_BillLastName ) AND
	                                         toupper( l.settings:address:email ) EQ toupper( g.Customer_BillEmail ) AND
	                                         toupper( l.settings:address:comp ) EQ toupper( g.Customer_BillCompany ) AND
	                                         toupper( l.settings:address:phone ) EQ toupper( g.Customer_BillPhone ) AND
	                                         toupper( l.settings:address:fax ) EQ toupper( g.Customer_BillFax ) AND
	                                         toupper( l.settings:address:addr1 ) EQ toupper( g.Customer_BillAddress1 ) AND
	                                         toupper( l.settings:address:addr2 ) EQ toupper( g.Customer_BillAddress2 ) AND
	                                         toupper( l.settings:address:city ) EQ toupper( g.Customer_BillCity ) AND
	                                         (
	                                            ( ( NOT ISNULL g.Customer_BillStateSelect ) AND ( toupper( l.settings:address:state ) EQ toupper( g.Customer_BillStateSelect ) ) ) OR
	                                            ( ( ISNULL g.Customer_BillStateSelect ) AND ( toupper( l.settings:address:state ) EQ toupper( g.Customer_BillState ) ) )
	                                         ) AND
	                                         toupper( l.settings:address:zip ) EQ toupper( g.Customer_BillZip ) AND
	                                         toupper( l.settings:address:cntry ) EQ toupper( g.Customer_BillCountry )">
	                            <option value="&mvte:address:id;" selected>&mvte:address:descrip;</option>
	                        <mvt:else>
	                            <option value="&mvte:address:id;">&mvte:address:descrip;</option>
	                        </mvt:if>
	                    </mvt:foreach>
	                </select>
	            </div>
	        </mvt:if>
		<div class="&mvte:global:BillFirstName_Row;">
			<label class="control-label required" for="Customer_BillFirstName">First Name:</label>
			<input type="text" name="Customer_BillFirstName" id="Customer_BillFirstName" value="&mvte:global:Customer_BillFirstName;" class="form-control" />
		</div>
		<div class="&mvte:global:BillLastName_Row;">
			<label class="control-label required" for="Customer_BillLastName">Last Name:</label>
			<input type="text" name="Customer_BillLastName" id="Customer_BillLastName" value="&mvte:global:Customer_BillLastName;" class="form-control" />
		</div>
		<div class="&mvte:global:BillEmail_Row;">
			<label class="control-label required" for="Customer_BillEmail">Email Address:</label>
			<input type="text" name="Customer_BillEmail" id="Customer_BillEmail" value="&mvte:global:Customer_BillEmail;" class="form-control" />
		</div>
		<div class="&mvte:global:BillPhone_Row;">
			<label class="control-label required" for="Customer_BillPhone">Phone Number:</label>
			<input type="text" name="Customer_BillPhone" id="Customer_BillPhone" value="&mvte:global:Customer_BillPhone;" class="form-control" />
		</div>
		<div class="&mvte:global:BillFax_Row;">
			<label class="control-label italic" for="Customer_BillFax">Fax Number:</label>
			<input type="text" name="Customer_BillFax" id="Customer_BillFax" value="&mvte:global:Customer_BillFax;" class="form-control" />
		</div>
		<div class="&mvte:global:BillCompany_Row;">
			<label class="control-label italic" for="Customer_BillCompany">Company:</label>
			<input type="text" name="Customer_BillCompany" id="Customer_BillCompany" value="&mvte:global:Customer_BillCompany;" class="form-control" />
		</div>
		<div class="&mvte:global:BillAddress1_Row;">
			<label class="control-label required" for="Customer_BillAddress1">Address:</label>
			<input type="text" name="Customer_BillAddress1" id="Customer_BillAddress1" value="&mvte:global:Customer_BillAddress1;" class="form-control" />
		</div>
		<div class="&mvte:global:BillAddress2_Row;">
			<label class="control-label italic" for="Customer_BillAddress2">Address 2:</label>
			<input type="text" name="Customer_BillAddress2" id="Customer_BillAddress2" value="&mvte:global:Customer_BillAddress2;" class="form-control" />
		</div>
		<div class="&mvte:global:BillCity_Row;">
			<label class="control-label required" for="Customer_BillCity">City:</label>
			<input type="text" name="Customer_BillCity" id="Customer_BillCity" value="&mvte:global:Customer_BillCity;" class="form-control" />
		</div>
		<mvt:if expr="g.States_Empty">
			<div class="&mvte:global:BillState_Row;">
				<label class="control-label required" for="Customer_BillState">State:</label>
				<input type="text" name="Customer_BillState" id="Customer_BillState" value="&mvte:global:Customer_BillState;" class="form-control" />
			</div>
			<mvt:else>
			<div class="&mvte:global:BillState_Row;">
				<label class="control-label required" for="Customer_BillStateSelect">State:</label>
				<mvt:item name="states" param="Customer_BillStateSelect" />
			</div>
			<div class="&mvte:global:BillState_Row;">
				<label class="control-label italic" for="Customer_BillState">Other State/Province:</label>
				<input type="text" name="Customer_BillState" id="Customer_BillState" value="&mvte:global:Customer_BillState;" class="form-control" />
			</div>
		</mvt:if>
		<div class="&mvte:global:BillZip_Row;">
			<label class="control-label required" for="Customer_BillZip">Zip:</label>
			<input type="text" name="Customer_BillZip" id="Customer_BillZip" value="&mvte:global:Customer_BillZip;" class="form-control" />
		</div>
		<div class="&mvt:global:BillCountry_Row;">
			<label class="control-label required" for="Customer_BillCountry">Country:</label>
			<mvt:item name="countries" param="Customer_BillCountry" />
		</div>
	</div>
</div>
<mvt:if expr="l.settings:customer:match">
	<mvt:if expr="l.settings:customer:primaddr EQ 'shipping'"> 
		<script>document.getElementById( 'billing_to_show' ).checked = true;</script>
	<mvt:elseif expr="l.settings:customer:primaddr EQ 'billing'">
		<script>document.getElementById( 'shipping_to_show' ).checked = true;</script> 
	</mvt:if>
</mvt:if>
<mvt:if expr="g.Basket:cust_id AND g.Customer_Session_Verified AND l.settings:customer:address_count">
    <script type="text/javascript">
        var MvCustomerAddresses = [];

        <mvt:foreach iterator="address" array="customer:addresses">
            MvCustomerAddresses[ <mvt:eval expr="int( l.settings:address:id )" /> ] = {
                "id":       <mvt:eval expr="int( l.settings:address:id )" />,
                "cust_id":  <mvt:eval expr="int( l.settings:address:cust_id )" />,
                "descrip":  "&mvtj:address:descrip;",
                "fname":    "&mvtj:address:fname;",
                "lname":    "&mvtj:address:lname;",
                "email":    "&mvtj:address:email;",
                "comp":     "&mvtj:address:comp;",
                "phone":    "&mvtj:address:phone;",
                "fax":      "&mvtj:address:fax;",
                "addr1":    "&mvtj:address:addr1;",
                "addr2":    "&mvtj:address:addr2;",
                "city":     "&mvtj:address:city;",
                "state":    "&mvtj:address:state;",
                "zip":      "&mvtj:address:zip;",
                "cntry":    "&mvtj:address:cntry;",
                "resdntl":  <mvt:if expr="l.settings:address:resdntl">true<mvt:else>false</mvt:if>
            };
        </mvt:foreach>
    </script>
</mvt:if>
<script src="&mvt:global:clientside_url;Store_Code=&mvta:store:code;&amp;Filename=ToggleDetails.js&amp;Primaddr=shipping&amp;Shipping=D&amp;Billing=O"></script>