"shipping" Snippets


View "Estimate Order Shipping Date"
<mvt:comment> Account for Daylight Savings time </mvt:comment> <mvt:if expr="s.tm_isdst"> <mvt:assign name="g.Timezone_Offset" value="'-5'" /> <mvt:assign name="g.Timezone_Abbreviation" value="'CDT'" /> <mvt:else> <mvt:assign name="g.Timezone_Offset" value="'-6'" /> <mvt:assign name="g.Timezone_Abbreviation" value="'CST'" /> </mvt:if> <mvt:if expr="s.tm_isdst"> <p>Daylight savings time <b>IS</b> in effect. Timezone Offset: &mvte:global:Timezone_Offset;</p> <mvt:else> <p>Daylight savings time is <b>NOT</b> in effect. Timezone Offset: &mvte:global:Timezone_Offset;</p> </mvt:if> <hr> <mvt:comment> Assign a Days-of-the-week text array for later </mvt:comment> <mvt:assign name="l.settings:daysofweek[1]" value="'Sunday'" /> <mvt:assign name="l.settings:daysofweek[2]" value="'Monday'" /> <mvt:assign name="l.settings:daysofweek[3]" value="'Tuesday'" /> <mvt:assign name="l.settings:daysofweek[4]" value="'Wednesday'" /> <mvt:assign name="l.settings:daysofweek[5]" value="'Thursday'" /> <mvt:assign name="l.settings:daysofweek[6]" value="'Friday'" /> <mvt:assign name="l.settings:daysofweek[7]" value="'Saturday'" /> <mvt:comment> Prepare days to simulate & test senarios </mvt:comment> <mvt:assign name="l.settings:senarios[1]:descrip" value="'Monday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[1]:timestamp" value="1470657660" /> <mvt:assign name="l.settings:senarios[2]:descrip" value="'Monday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[2]:timestamp" value="1470693660" /> <mvt:assign name="l.settings:senarios[3]:descrip" value="'Tuesday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[3]:timestamp" value="1470744060" /> <mvt:assign name="l.settings:senarios[4]:descrip" value="'Tuesday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[4]:timestamp" value="1470780060" /> <mvt:assign name="l.settings:senarios[5]:descrip" value="'Wednesday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[5]:timestamp" value="1470830460" /> <mvt:assign name="l.settings:senarios[6]:descrip" value="'Wednesday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[6]:timestamp" value="1470866460" /> <mvt:assign name="l.settings:senarios[7]:descrip" value="'Thursday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[7]:timestamp" value="1470916860" /> <mvt:assign name="l.settings:senarios[8]:descrip" value="'Thursday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[8]:timestamp" value="1470952860" /> <mvt:assign name="l.settings:senarios[9]:descrip" value="'Friday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[9]:timestamp" value="1471003260" /> <mvt:assign name="l.settings:senarios[10]:descrip" value="'Friday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[10]:timestamp" value="1471039260" /> <mvt:assign name="l.settings:senarios[11]:descrip" value="'Saturday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[11]:timestamp" value="1471089660" /> <mvt:assign name="l.settings:senarios[12]:descrip" value="'Saturday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[12]:timestamp" value="1471125660" /> <mvt:assign name="l.settings:senarios[13]:descrip" value="'Sunday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[13]:timestamp" value="1471089660" /> <mvt:assign name="l.settings:senarios[14]:descrip" value="'Sunday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[14]:timestamp" value="1471125660" /> <mvt:comment> Loop over each senario and test the estimation logic </mvt:comment> <mvt:foreach iterator="senario" array="senarios"> <mvt:comment> Assign some date-time variables that make it easier to read, write, and compare dates when we apply the estimation logic </mvt:comment> <mvt:assign name="l.settings:senario:date:year" value="time_t_year( l.settings:senario:timestamp, g.Timezone_Offset )" /> <mvt:assign name="l.settings:senario:date:month" value="padl(time_t_month( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:day" value="padl(time_t_dayofmonth( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:dayofweek" value="time_t_dayofweek( l.settings:senario:timestamp, g.Timezone_Offset )" /> <mvt:assign name="l.settings:senario:date:dayofweek_formatted" value="l.settings:daysofweek[time_t_dayofweek( l.settings:senario:timestamp, g.Timezone_Offset )]" /> <mvt:assign name="l.settings:senario:date:hour" value="padl(time_t_hour( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:min" value="padl(time_t_min( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:sec" value="padl(time_t_sec( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:formatted" value="l.settings:senario:date:year $ '-' $ l.settings:senario:date:month $ '-' $ l.settings:senario:date:day $ ' ' $ l.settings:senario:date:hour $ ':' $ l.settings:senario:date:min $ ':' $ l.settings:senario:date:sec $ ' ' $ g.Timezone_Offset" /> <h2>Senario: &mvt:senario:descrip;<small>&mvt:senario:date:formatted;</small></h2> <mvt:if expr="l.settings:senario:date:dayofweek_formatted CIN 'Monday, Tuesday, Wednesday, Thursday' AND l.settings:senario:date:hour LT 10"> <mvt:comment> Estimation Logic: Ship Today </mvt:comment> <mvt:assign name="l.settings:senario:cutoff:hours" value="10 - l.settings:senario:date:hour" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="60 - l.settings:senario:date:min" /> <mvt:if expr="l.settings:senario:cutoff:minutes EQ 60"> <mvt:assign name="l.settings:senario:cutoff:hours" value="l.settings:senario:cutoff:hours + 1" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="0" /> </mvt:if> <h3>Order within <b>&mvt:senario:cutoff:hours; hours &mvt:senario:cutoff:minutes; minutes</b>, and it should ship today.</h3> <mvt:elseif expr="l.settings:senario:date:dayofweek_formatted CIN 'Monday, Tuesday, Wednesday' AND l.settings:senario:date:hour GE 10"> <mvt:comment> Estimation Logic: Ship Tomorrow </mvt:comment> <mvt:assign name="l.settings:senario:cutoff:hours" value="34 - l.settings:senario:date:hour" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="60 - l.settings:senario:date:min" /> <mvt:if expr="l.settings:senario:cutoff:minutes EQ 60"> <mvt:assign name="l.settings:senario:cutoff:hours" value="l.settings:senario:cutoff:hours + 1" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="0" /> </mvt:if> <mvt:comment><h3>Order within <b>&mvt:senario:cutoff:hours; hours &mvt:senario:cutoff:minutes; minutes</b> and it should ship tomorrow.</h3></mvt:comment> <h3>Order today, and it should ship tomorrow.</h3> <mvt:else> <mvt:comment> Estimation Logic: Ship Monday </mvt:comment> <h3>Order today, and it should ship on Monday.</h3> </mvt:if> <p> <small> <ul> <li>From Monday to Thursday, orders placed <i>before</i> 10am will <b>ship the same day</b></li> <li>From Monday to Wednesday, orders placed <i>after</i> 10am will <b>ship the next day</b></li> <li>All other others (Thursday after 10am to Monday before 10 am) will be <b>shipped on Monday</b>.</li> </ul> </small> </p> <br><hr><br> </mvt:foreach> <mvt:comment> Just a Debugging Helper </mvt:comment> <mvt:comment> <mvt:eval expr="glosub(miva_array_serialize(l.settings:senarios), ',', '<br>')" /> </mvt:comment>
 
View "Estimate Order Shipping Date"
<mvt:comment> Account for Daylight Savings time </mvt:comment> <mvt:if expr="s.tm_isdst"> <mvt:assign name="g.Timezone_Offset" value="'-5'" /> <mvt:assign name="g.Timezone_Abbreviation" value="'CDT'" /> <mvt:else> <mvt:assign name="g.Timezone_Offset" value="'-6'" /> <mvt:assign name="g.Timezone_Abbreviation" value="'CST'" /> </mvt:if> <mvt:if expr="s.tm_isdst"> <p>Daylight savings time <b>IS</b> in effect. Timezone Offset: &mvte:global:Timezone_Offset;</p> <mvt:else> <p>Daylight savings time is <b>NOT</b> in effect. Timezone Offset: &mvte:global:Timezone_Offset;</p> </mvt:if> <hr> <mvt:comment> Assign a Days-of-the-week text array for later </mvt:comment> <mvt:assign name="l.settings:daysofweek[1]" value="'Sunday'" /> <mvt:assign name="l.settings:daysofweek[2]" value="'Monday'" /> <mvt:assign name="l.settings:daysofweek[3]" value="'Tuesday'" /> <mvt:assign name="l.settings:daysofweek[4]" value="'Wednesday'" /> <mvt:assign name="l.settings:daysofweek[5]" value="'Thursday'" /> <mvt:assign name="l.settings:daysofweek[6]" value="'Friday'" /> <mvt:assign name="l.settings:daysofweek[7]" value="'Saturday'" /> <mvt:comment> Prepare days to simulate & test senarios </mvt:comment> <mvt:assign name="l.settings:senarios[1]:descrip" value="'Monday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[1]:timestamp" value="1470657660" /> <mvt:assign name="l.settings:senarios[2]:descrip" value="'Monday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[2]:timestamp" value="1470693660" /> <mvt:assign name="l.settings:senarios[3]:descrip" value="'Tuesday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[3]:timestamp" value="1470744060" /> <mvt:assign name="l.settings:senarios[4]:descrip" value="'Tuesday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[4]:timestamp" value="1470780060" /> <mvt:assign name="l.settings:senarios[5]:descrip" value="'Wednesday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[5]:timestamp" value="1470830460" /> <mvt:assign name="l.settings:senarios[6]:descrip" value="'Wednesday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[6]:timestamp" value="1470866460" /> <mvt:assign name="l.settings:senarios[7]:descrip" value="'Thursday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[7]:timestamp" value="1470916860" /> <mvt:assign name="l.settings:senarios[8]:descrip" value="'Thursday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[8]:timestamp" value="1470952860" /> <mvt:assign name="l.settings:senarios[9]:descrip" value="'Friday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[9]:timestamp" value="1471003260" /> <mvt:assign name="l.settings:senarios[10]:descrip" value="'Friday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[10]:timestamp" value="1471039260" /> <mvt:assign name="l.settings:senarios[11]:descrip" value="'Saturday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[11]:timestamp" value="1471089660" /> <mvt:assign name="l.settings:senarios[12]:descrip" value="'Saturday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[12]:timestamp" value="1471125660" /> <mvt:assign name="l.settings:senarios[13]:descrip" value="'Sunday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[13]:timestamp" value="1471089660" /> <mvt:assign name="l.settings:senarios[14]:descrip" value="'Sunday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[14]:timestamp" value="1471125660" /> <mvt:comment> Loop over each senario and test the estimation logic </mvt:comment> <mvt:foreach iterator="senario" array="senarios"> <mvt:comment> Assign some date-time variables that make it easier to read, write, and compare dates when we apply the estimation logic </mvt:comment> <mvt:assign name="l.settings:senario:date:year" value="time_t_year( l.settings:senario:timestamp, g.Timezone_Offset )" /> <mvt:assign name="l.settings:senario:date:month" value="padl(time_t_month( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:day" value="padl(time_t_dayofmonth( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:dayofweek" value="time_t_dayofweek( l.settings:senario:timestamp, g.Timezone_Offset )" /> <mvt:assign name="l.settings:senario:date:dayofweek_formatted" value="l.settings:daysofweek[time_t_dayofweek( l.settings:senario:timestamp, g.Timezone_Offset )]" /> <mvt:assign name="l.settings:senario:date:24hour" value="padl(time_t_hour( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:min" value="padl(time_t_min( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:sec" value="padl(time_t_sec( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:formatted" value="l.settings:senario:date:year $ '-' $ l.settings:senario:date:month $ '-' $ l.settings:senario:date:day $ ' ' $ l.settings:senario:date:24hour $ ':' $ l.settings:senario:date:min $ ':' $ l.settings:senario:date:sec $ ' ' $ g.Timezone_Offset" /> <h2 style='color: gray'> Senario #<mvt:eval expr="POS1"/>: &mvt:senario:descrip; <small>&mvt:senario:date:formatted;</small> </h2> <mvt:if expr="l.settings:senario:date:dayofweek_formatted CIN 'Monday, Tuesday, Wednesday, Thursday' AND l.settings:senario:date:24hour LT 10"> <mvt:comment> Estimation Logic: Ship Today </mvt:comment> <mvt:assign name="l.settings:senario:cutoff:hours" value="10 - l.settings:senario:date:24hour" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="60 - l.settings:senario:date:min" /> <mvt:if expr="l.settings:senario:cutoff:minutes EQ 60"> <mvt:assign name="l.settings:senario:cutoff:hours" value="l.settings:senario:cutoff:hours + 1" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="0" /> </mvt:if> <h3>Order within <b>&mvt:senario:cutoff:hours; hours &mvt:senario:cutoff:minutes; minutes</b>, and it should ship today.</h3> <mvt:elseif expr="l.settings:senario:date:dayofweek_formatted CIN 'Monday, Tuesday, Wednesday' AND l.settings:senario:date:24hour GE 10"> <mvt:comment> Estimation Logic: Ship Tomorrow </mvt:comment> <mvt:assign name="l.settings:senario:cutoff:hours" value="34 - l.settings:senario:date:24hour" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="60 - l.settings:senario:date:min" /> <mvt:if expr="l.settings:senario:cutoff:minutes EQ 60"> <mvt:assign name="l.settings:senario:cutoff:hours" value="l.settings:senario:cutoff:hours + 1" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="0" /> </mvt:if> <mvt:comment><h3>Order within <b>&mvt:senario:cutoff:hours; hours &mvt:senario:cutoff:minutes; minutes</b> and it should ship tomorrow.</h3></mvt:comment> <h3>Order today, and it should ship tomorrow.</h3> <mvt:else> <mvt:comment> Estimation Logic: Ship Monday </mvt:comment> <h3>Order today, and it should ship on Monday.</h3> </mvt:if> <p> <small> <ul> <li>From Monday to Thursday, orders placed <i>before</i> 10am will ship the same day.</li> <li>From Monday to Wednesday, orders placed <i>after</i> 10am will ship the next day.</li> <li>All other others (Thursday after 10am to Monday before 10 am) will be shipped on Monday.</li> </ul> </small> </p> <br><br><hr><br><br> </mvt:foreach> <mvt:comment> Just a Debugging Helper </mvt:comment> <mvt:comment><mvt:eval expr="glosub(miva_array_serialize(l.settings:senarios), ',', '<br>')" /></mvt:comment>
 
View "Estimate Order Shipping Date"
<mvt:comment> Account for Daylight Savings time </mvt:comment> <mvt:if expr="s.tm_isdst"> <mvt:assign name="g.Timezone_Offset" value="'-5'" /> <mvt:assign name="g.Timezone_Abbreviation" value="'CDT'" /> <mvt:else> <mvt:assign name="g.Timezone_Offset" value="'-6'" /> <mvt:assign name="g.Timezone_Abbreviation" value="'CST'" /> </mvt:if> <mvt:if expr="s.tm_isdst"> <p>Daylight savings time <b>IS</b> in effect. Timezone Offset: &mvte:global:Timezone_Offset;</p> <mvt:else> <p>Daylight savings time is <b>NOT</b> in effect. Timezone Offset: &mvte:global:Timezone_Offset;</p> </mvt:if> <hr> <mvt:comment> Assign a Days-of-the-week text array for later </mvt:comment> <mvt:assign name="l.settings:daysofweek[1]" value="'Sunday'" /> <mvt:assign name="l.settings:daysofweek[2]" value="'Monday'" /> <mvt:assign name="l.settings:daysofweek[3]" value="'Tuesday'" /> <mvt:assign name="l.settings:daysofweek[4]" value="'Wednesday'" /> <mvt:assign name="l.settings:daysofweek[5]" value="'Thursday'" /> <mvt:assign name="l.settings:daysofweek[6]" value="'Friday'" /> <mvt:assign name="l.settings:daysofweek[7]" value="'Saturday'" /> <mvt:comment> Prepare days to simulate & test senarios </mvt:comment> <mvt:assign name="l.settings:senarios[1]:descrip" value="'Monday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[1]:timestamp" value="1470657660" /> <mvt:assign name="l.settings:senarios[2]:descrip" value="'Monday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[2]:timestamp" value="1470693660" /> <mvt:assign name="l.settings:senarios[3]:descrip" value="'Tuesday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[3]:timestamp" value="1470744060" /> <mvt:assign name="l.settings:senarios[4]:descrip" value="'Tuesday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[4]:timestamp" value="1470780060" /> <mvt:assign name="l.settings:senarios[5]:descrip" value="'Wednesday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[5]:timestamp" value="1470830460" /> <mvt:assign name="l.settings:senarios[6]:descrip" value="'Wednesday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[6]:timestamp" value="1470866460" /> <mvt:assign name="l.settings:senarios[7]:descrip" value="'Thursday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[7]:timestamp" value="1470916860" /> <mvt:assign name="l.settings:senarios[8]:descrip" value="'Thursday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[8]:timestamp" value="1470952860" /> <mvt:assign name="l.settings:senarios[9]:descrip" value="'Friday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[9]:timestamp" value="1471003260" /> <mvt:assign name="l.settings:senarios[10]:descrip" value="'Friday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[10]:timestamp" value="1471039260" /> <mvt:assign name="l.settings:senarios[11]:descrip" value="'Saturday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[11]:timestamp" value="1471089660" /> <mvt:assign name="l.settings:senarios[12]:descrip" value="'Saturday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[12]:timestamp" value="1471125660" /> <mvt:assign name="l.settings:senarios[13]:descrip" value="'Sunday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[13]:timestamp" value="1471089660" /> <mvt:assign name="l.settings:senarios[14]:descrip" value="'Sunday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[14]:timestamp" value="1471125660" /> <mvt:comment> Loop over each senario and test the estimation logic </mvt:comment> <mvt:foreach iterator="senario" array="senarios"> <mvt:comment> Assign some date-time variables that make it easier to read, write, and compare dates when we apply the estimation logic </mvt:comment> <mvt:assign name="l.settings:senario:date:year" value="time_t_year( l.settings:senario:timestamp, g.Timezone_Offset )" /> <mvt:assign name="l.settings:senario:date:month" value="padl(time_t_month( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:day" value="padl(time_t_dayofmonth( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:dayofweek" value="time_t_dayofweek( l.settings:senario:timestamp, g.Timezone_Offset )" /> <mvt:assign name="l.settings:senario:date:dayofweek_formatted" value="l.settings:daysofweek[time_t_dayofweek( l.settings:senario:timestamp, g.Timezone_Offset )]" /> <mvt:assign name="l.settings:senario:date:24hour" value="padl(time_t_hour( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:min" value="padl(time_t_min( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:sec" value="padl(time_t_sec( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:formatted" value="l.settings:senario:date:year $ '-' $ l.settings:senario:date:month $ '-' $ l.settings:senario:date:day $ ' ' $ l.settings:senario:date:24hour $ ':' $ l.settings:senario:date:min $ ':' $ l.settings:senario:date:sec $ ' ' $ g.Timezone_Offset" /> <h2 style='color: gray'> Senario #<mvt:eval expr="POS1"/>: &mvt:senario:descrip; <small>&mvt:senario:date:formatted;</small> </h2> <mvt:if expr="l.settings:senario:date:dayofweek_formatted CIN 'Monday, Tuesday, Wednesday, Thursday' AND l.settings:senario:date:24hour LT 10"> <mvt:comment> Estimation Logic: Ship Today </mvt:comment> <mvt:assign name="l.settings:senario:cutoff:hours" value="10 - l.settings:senario:date:24hour" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="60 - l.settings:senario:date:min" /> <mvt:if expr="l.settings:senario:cutoff:minutes EQ 60"> <mvt:assign name="l.settings:senario:cutoff:hours" value="l.settings:senario:cutoff:hours + 1" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="0" /> </mvt:if> <h3>Order within <b>&mvt:senario:cutoff:hours; hours &mvt:senario:cutoff:minutes; minutes</b>, and it should ship today.</h3> <mvt:elseif expr="l.settings:senario:date:dayofweek_formatted CIN 'Monday, Tuesday, Wednesday' AND l.settings:senario:date:24hour GE 10"> <mvt:comment> Estimation Logic: Ship Tomorrow </mvt:comment> <mvt:assign name="l.settings:senario:cutoff:hours" value="34 - l.settings:senario:date:24hour" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="60 - l.settings:senario:date:min" /> <mvt:if expr="l.settings:senario:cutoff:minutes EQ 60"> <mvt:assign name="l.settings:senario:cutoff:hours" value="l.settings:senario:cutoff:hours + 1" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="0" /> </mvt:if> <mvt:comment><h3>Order within <b>&mvt:senario:cutoff:hours; hours &mvt:senario:cutoff:minutes; minutes</b> and it should ship tomorrow.</h3></mvt:comment> <h3>Order today, and it should ship tomorrow.</h3> <mvt:else> <mvt:comment> Estimation Logic: Ship Monday </mvt:comment> <h3>Order today, and it should ship on Monday.</h3> </mvt:if> <p> <small> <ul> <li>From Monday to Thursday, orders placed <i>before</i> 10am will ship the same day.</li> <li>From Monday to Wednesday, orders placed <i>after</i> 10am will ship the next day.</li> <li>All other others (Thursday after 10am to Monday before 10 am) will be shipped on Monday.</li> </ul> </small> </p> <br><br><hr><br><br> </mvt:foreach> <mvt:comment> Just a Debugging Helper </mvt:comment> <mvt:eval expr="glosub(miva_array_serialize(l.settings:senarios), ',', '<br>')" />
 
View "Estimate Order Shipping Date"
<mvt:comment> Account for Daylight Savings time </mvt:comment> <mvt:if expr="s.tm_isdst"> <mvt:assign name="g.Timezone_Offset" value="'-5'" /> <mvt:assign name="g.Timezone_Abbreviation" value="'CDT'" /> <mvt:else> <mvt:assign name="g.Timezone_Offset" value="'-6'" /> <mvt:assign name="g.Timezone_Abbreviation" value="'CST'" /> </mvt:if> <mvt:if expr="s.tm_isdst"> <p>Daylight savings time <b>IS</b> in effect. Timezone Offset: &mvte:global:Timezone_Offset;</p> <mvt:else> <p>Daylight savings time is <b>NOT</b> in effect. Timezone Offset: &mvte:global:Timezone_Offset;</p> </mvt:if> <hr> <mvt:comment> Assign a Days-of-the-week text array for later </mvt:comment> <mvt:assign name="l.settings:daysofweek[1]" value="'Sunday'" /> <mvt:assign name="l.settings:daysofweek[2]" value="'Monday'" /> <mvt:assign name="l.settings:daysofweek[3]" value="'Tuesday'" /> <mvt:assign name="l.settings:daysofweek[4]" value="'Wednesday'" /> <mvt:assign name="l.settings:daysofweek[5]" value="'Thursday'" /> <mvt:assign name="l.settings:daysofweek[6]" value="'Friday'" /> <mvt:assign name="l.settings:daysofweek[7]" value="'Saturday'" /> <mvt:comment> Prepare days to simulate & test senarios </mvt:comment> <mvt:assign name="l.settings:senarios[1]:descrip" value="'Monday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[1]:timestamp" value="1470657660" /> <mvt:assign name="l.settings:senarios[2]:descrip" value="'Monday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[2]:timestamp" value="1470693660" /> <mvt:assign name="l.settings:senarios[3]:descrip" value="'Tuesday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[3]:timestamp" value="1470744060" /> <mvt:assign name="l.settings:senarios[4]:descrip" value="'Tuesday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[4]:timestamp" value="1470780060" /> <mvt:assign name="l.settings:senarios[5]:descrip" value="'Wednesday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[5]:timestamp" value="1470830460" /> <mvt:assign name="l.settings:senarios[6]:descrip" value="'Wednesday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[6]:timestamp" value="1470866460" /> <mvt:assign name="l.settings:senarios[7]:descrip" value="'Thursday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[7]:timestamp" value="1470916860" /> <mvt:assign name="l.settings:senarios[8]:descrip" value="'Thursday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[8]:timestamp" value="1470952860" /> <mvt:assign name="l.settings:senarios[9]:descrip" value="'Friday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[9]:timestamp" value="1471003260" /> <mvt:assign name="l.settings:senarios[10]:descrip" value="'Friday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[10]:timestamp" value="1471039260" /> <mvt:assign name="l.settings:senarios[11]:descrip" value="'Saturday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[11]:timestamp" value="1471089660" /> <mvt:assign name="l.settings:senarios[12]:descrip" value="'Saturday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[12]:timestamp" value="1471125660" /> <mvt:assign name="l.settings:senarios[13]:descrip" value="'Sunday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[13]:timestamp" value="1471089660" /> <mvt:assign name="l.settings:senarios[14]:descrip" value="'Sunday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[14]:timestamp" value="1471125660" /> <mvt:comment> Loop over each senario and test the estimation logic </mvt:comment> <mvt:foreach iterator="senario" array="senarios"> <mvt:comment> Assign some date-time variables that make it easier to read, write, and compare dates when we apply the estimation logic </mvt:comment> <mvt:assign name="l.settings:senario:date:year" value="time_t_year( l.settings:senario:timestamp, g.Timezone_Offset )" /> <mvt:assign name="l.settings:senario:date:month" value="padl(time_t_month( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:day" value="padl(time_t_dayofmonth( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:dayofweek" value="time_t_dayofweek( l.settings:senario:timestamp, g.Timezone_Offset )" /> <mvt:assign name="l.settings:senario:date:dayofweek_formatted" value="l.settings:daysofweek[time_t_dayofweek( l.settings:senario:timestamp, g.Timezone_Offset )]" /> <mvt:assign name="l.settings:senario:date:24hour" value="padl(time_t_hour( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:min" value="padl(time_t_min( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:sec" value="padl(time_t_sec( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:formatted" value="l.settings:senario:date:year $ '-' $ l.settings:senario:date:month $ '-' $ l.settings:senario:date:day $ ' ' $ l.settings:senario:date:24hour $ ':' $ l.settings:senario:date:min $ ':' $ l.settings:senario:date:sec $ ' ' $ g.Timezone_Offset" /> <h2 style='color: gray'> Senario #<mvt:eval expr="POS1"/>: &mvt:senario:descrip; <small>&mvt:senario:date:formatted;</small> </h2> <mvt:if expr="l.settings:senario:date:dayofweek_formatted CIN 'Monday, Tuesday, Wednesday, Thursday' AND l.settings:senario:date:24hour LT 10"> <mvt:comment> Estimation Logic: Ship Today </mvt:comment> <mvt:assign name="l.settings:senario:cutoff:hours" value="10 - l.settings:senario:date:24hour" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="60 - l.settings:senario:date:min" /> <mvt:if expr="l.settings:senario:cutoff:minutes EQ 60"> <mvt:assign name="l.settings:senario:cutoff:hours" value="l.settings:senario:cutoff:hours + 1" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="0" /> </mvt:if> <h3>Order within <b>&mvt:senario:cutoff:hours; hours &mvt:senario:cutoff:minutes; minutes</b>, and it should ship today.</h3> <mvt:elseif expr="l.settings:senario:date:dayofweek_formatted CIN 'Monday, Tuesday, Wednesday' AND l.settings:senario:date:24hour GE 10"> <mvt:comment> Estimation Logic: Ship Tomorrow </mvt:comment> <mvt:assign name="l.settings:senario:cutoff:hours" value="34 - l.settings:senario:date:24hour" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="60 - l.settings:senario:date:min" /> <mvt:if expr="l.settings:senario:cutoff:minutes EQ 60"> <mvt:assign name="l.settings:senario:cutoff:hours" value="l.settings:senario:cutoff:hours + 1" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="0" /> </mvt:if> <mvt:comment><h3>Order within <b>&mvt:senario:cutoff:hours; hours &mvt:senario:cutoff:minutes; minutes</b> and it should ship tomorrow.</h3></mvt:comment> <h3>Order today, and it should ship tomorrow.</h3> <mvt:else> <mvt:comment> Estimation Logic: Ship Monday </mvt:comment> <h3>Order today, and it should ship on Monday.</h3> </mvt:if> <p> <small> <ul> <li>From Monday to Thursday, orders placed <i>before</i> 10am will <b>ship the same day</b></li> <li>From Monday to Wednesday, orders placed <i>after</i> 10am will <b>ship the next day</b></li> <li>All other others (Thursday after 10am to Monday before 10 am) will be <b>shipped on Monday</b>.</li> </ul> </small> </p> <br><hr><br> </mvt:foreach> <mvt:comment> Just a Debugging Helper </mvt:comment> <mvt:eval expr="glosub(miva_array_serialize(l.settings:senarios), ',', '<br>')" />
 
View "Estimate Order Shipping Date"
<mvt:if expr="s.tm_isdst"> <mvt:assign name="g.Timezone_Offset" value="'-5'" /> <mvt:assign name="g.Timezone_Abbreviation" value="'CDT'" /> <mvt:else> <mvt:assign name="g.Timezone_Offset" value="'-6'" /> <mvt:assign name="g.Timezone_Abbreviation" value="'CST'" /> </mvt:if> <mvt:if expr="s.tm_isdst"> <p>Daylight savings time <b>IS</b> in effect. Timezone Offset: &mvte:global:Timezone_Offset;</p> <mvt:else> <p>Daylight savings time is <b>NOT</b> in effect. Timezone Offset: &mvte:global:Timezone_Offset;</p> </mvt:if> <mvt:assign name="l.settings:daysofweek[1]" value="'Sunday'" /> <mvt:assign name="l.settings:daysofweek[2]" value="'Monday'" /> <mvt:assign name="l.settings:daysofweek[3]" value="'Tuesday'" /> <mvt:assign name="l.settings:daysofweek[4]" value="'Wednesday'" /> <mvt:assign name="l.settings:daysofweek[5]" value="'Thursday'" /> <mvt:assign name="l.settings:daysofweek[6]" value="'Friday'" /> <mvt:assign name="l.settings:daysofweek[7]" value="'Saturday'" /> <hr> <mvt:assign name="l.settings:senarios[1]:descrip" value="'Monday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[1]:timestamp" value="1470657660" /> <mvt:assign name="l.settings:senarios[2]:descrip" value="'Monday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[2]:timestamp" value="1470693660" /> <mvt:assign name="l.settings:senarios[3]:descrip" value="'Tuesday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[3]:timestamp" value="1470744060" /> <mvt:assign name="l.settings:senarios[4]:descrip" value="'Tuesday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[4]:timestamp" value="1470780060" /> <mvt:assign name="l.settings:senarios[5]:descrip" value="'Wednesday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[5]:timestamp" value="1470830460" /> <mvt:assign name="l.settings:senarios[6]:descrip" value="'Wednesday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[6]:timestamp" value="1470866460" /> <mvt:assign name="l.settings:senarios[7]:descrip" value="'Thursday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[7]:timestamp" value="1470916860" /> <mvt:assign name="l.settings:senarios[8]:descrip" value="'Thursday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[8]:timestamp" value="1470952860" /> <mvt:assign name="l.settings:senarios[9]:descrip" value="'Friday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[9]:timestamp" value="1471003260" /> <mvt:assign name="l.settings:senarios[10]:descrip" value="'Friday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[10]:timestamp" value="1471039260" /> <mvt:assign name="l.settings:senarios[11]:descrip" value="'Saturday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[11]:timestamp" value="1471089660" /> <mvt:assign name="l.settings:senarios[12]:descrip" value="'Saturday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[12]:timestamp" value="1471125660" /> <mvt:assign name="l.settings:senarios[13]:descrip" value="'Sunday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[13]:timestamp" value="1471089660" /> <mvt:assign name="l.settings:senarios[14]:descrip" value="'Sunday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[14]:timestamp" value="1471125660" /> <mvt:foreach iterator="senario" array="senarios"> <mvt:assign name="l.settings:senario:date:year" value="time_t_year( l.settings:senario:timestamp, g.Timezone_Offset )" /> <mvt:assign name="l.settings:senario:date:month" value="padl(time_t_month( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:day" value="padl(time_t_dayofmonth( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:dayofweek" value="time_t_dayofweek( l.settings:senario:timestamp, g.Timezone_Offset )" /> <mvt:assign name="l.settings:senario:date:dayofweek_formatted" value="l.settings:daysofweek[time_t_dayofweek( l.settings:senario:timestamp, g.Timezone_Offset )]" /> <mvt:assign name="l.settings:senario:date:24hour" value="padl(time_t_hour( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:min" value="padl(time_t_min( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:sec" value="padl(time_t_sec( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:formatted" value="l.settings:senario:date:year $ '-' $ l.settings:senario:date:month $ '-' $ l.settings:senario:date:day $ ' ' $ l.settings:senario:date:24hour $ ':' $ l.settings:senario:date:min $ ':' $ l.settings:senario:date:sec $ ' ' $ g.Timezone_Offset" /> <h2 style="color: gray;">Senario #<mvt:eval expr="POS1"/>: &mvt:senario:descrip; <small>&mvt:senario:date:formatted;</small></h2> <mvt:if expr="l.settings:senario:date:dayofweek_formatted CIN 'Monday, Tuesday, Wednesday, Thursday' AND l.settings:senario:date:24hour LT 10"> <mvt:comment> Ship Today </mvt:comment> <mvt:assign name="l.settings:senario:cutoff:hours" value="10 - l.settings:senario:date:24hour" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="60 - l.settings:senario:date:min" /> <mvt:if expr="l.settings:senario:cutoff:minutes EQ 60"> <mvt:assign name="l.settings:senario:cutoff:hours" value="l.settings:senario:cutoff:hours + 1" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="0" /> </mvt:if> <h3>Order within <b>&mvt:senario:cutoff:hours; hours &mvt:senario:cutoff:minutes; minutes</b> and it should ship today.</h3> <mvt:elseif expr="l.settings:senario:date:dayofweek_formatted CIN 'Monday, Tuesday, Wednesday' AND l.settings:senario:date:24hour GE 10"> <mvt:comment> | Ship Tomorrow </mvt:comment> <mvt:assign name="l.settings:senario:cutoff:hours" value="34 - l.settings:senario:date:24hour" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="60 - l.settings:senario:date:min" /> <mvt:if expr="l.settings:senario:cutoff:minutes EQ 60"> <mvt:assign name="l.settings:senario:cutoff:hours" value="l.settings:senario:cutoff:hours + 1" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="0" /> </mvt:if> <mvt:comment><h3>Order within <b>&mvt:senario:cutoff:hours; hours &mvt:senario:cutoff:minutes; minutes</b> and it should ship tomorrow.</h3></mvt:comment> <h3>Order today and it should ship tomorrow.</h3> <mvt:else> <mvt:comment> Ship Monday </mvt:comment> <h3>Order today and it should ship monday.</h3> </mvt:if> <p> <small> <ul> <li>From Monday to Thursday, orders placed <i>before</i> 10am will <b>ship the same day</b></li> <li>From Monday to Wednesday, orders placed <i>after</i> 10am will <b>ship the next day</b></li> <li>All other others (Thursday after 10am to Monday before 10 am) will be <b>shipped on Monday</b>.</li> </ul> </small> </p> <br><hr><br> </mvt:foreach> <mvt:eval expr="glosub(miva_array_serialize(l.settings:senarios), ',', '<br>')" />
 

Basket #15788

Created: 1460056611
View "Basket #15788"
<mvt:comment><!-- Days --></mvt:comment> <mvt:assign name="g.timezone_offset" value="'local'" /> <mvt:assign name="l.settings:days[1]:name" value="'Sunday'" /> <mvt:assign name="l.settings:days[1]:time" value="1431284400" /> <mvt:assign name="l.settings:days[2]:name" value="'Monday'" /> <mvt:assign name="l.settings:days[2]:time" value="1431370800" /> <mvt:assign name="l.settings:days[3]:name" value="'Tuesday'" /> <mvt:assign name="l.settings:days[3]:time" value="1431457200" /> <mvt:assign name="l.settings:days[4]:name" value="'Wednesday'" /> <mvt:assign name="l.settings:days[4]:time" value="1431543600" /> <mvt:assign name="l.settings:days[5]:name" value="'Thursday'" /> <mvt:assign name="l.settings:days[5]:time" value="1431630000" /> <mvt:assign name="l.settings:days[6]:name" value="'Friday'" /> <mvt:assign name="l.settings:days[6]:time" value="1431716400" /> <mvt:assign name="l.settings:days[7]:name" value="'Saturday'" /> <mvt:assign name="l.settings:days[7]:time" value="1431802800" /> <mvt:comment><!-- Shipping Methods --></mvt:comment> <mvt:assign name="l.settings:shippingmethods[1]:name" value="'Next Day'" /> <mvt:assign name="l.settings:shippingmethods[1]:delivery:min" value="1" /> <mvt:assign name="l.settings:shippingmethods[1]:delivery:max" value="1" /> <mvt:assign name="l.settings:shippingmethods[2]:name" value="'2nd Day'" /> <mvt:assign name="l.settings:shippingmethods[2]:delivery:min" value="2" /> <mvt:assign name="l.settings:shippingmethods[2]:delivery:max" value="2" /> <mvt:assign name="l.settings:shippingmethods[3]:name" value="'Ground'" /> <mvt:assign name="l.settings:shippingmethods[3]:delivery:min" value="7" /> <mvt:assign name="l.settings:shippingmethods[3]:delivery:max" value="10" /> <mvt:foreach iterator="day" array="days"> <mvt:assign name="l.settings:day:month" value="time_t_month( l.settings:day:time, g.timezone_offset )" /> <mvt:assign name="l.settings:day:day" value="time_t_dayofmonth( l.settings:day:time, g.timezone_offset )" /> <mvt:assign name="l.settings:day:formatted_date" value="l.settings:day:month $ '/' $ l.settings:day:day" /> <h2>Order Placed: &mvt:day:name; @ &mvt:day:formatted_date;</h2> <mvt:foreach iterator="method" array="shippingmethods"> <mvt:assign name="l.settings:method:elapsed:days" value="0" /> <mvt:assign name="l.settings:method:shipping:days" value="0" /> <mvt:assign name="l.settings:method:processing:days" value="4" /> <mvt:assign name="l.settings:method:delivered" value="''" /> <mvt:assign name="l.settings:method:estimated:min" value="''" /> <mvt:assign name="l.settings:method:estimated:max" value="''" /> <mvt:while expr="ISNULL l.settings:method:delivered"> <mvt:assign name="l.settings:method:counter" value="l.settings:method:counter + 1" /> <mvt:assign name="l.settings:method:elapsed:days" value="l.settings:method:elapsed:days + 1" /> <mvt:assign name="l.settings:method:elapsed:duration" value="60 * 60 * 24 * l.settings:method:elapsed:days" /> <mvt:assign name="l.settings:method:elapsed:future_time" value="l.settings:day:time + l.settings:method:elapsed:duration"/> <mvt:assign name="l.settings:method:estimated:month" value="time_t_month( l.settings:method:elapsed:future_time, g.timezone_offset )" /> <mvt:assign name="l.settings:method:estimated:day" value="time_t_dayofmonth( l.settings:method:elapsed:future_time, g.timezone_offset )" /> <mvt:assign name="l.settings:method:estimated:dayofweek" value="time_t_dayofweek( l.settings:method:elapsed:future_time, g.timezone_offset )" /> <mvt:if expr="l.settings:method:estimated:dayofweek GT 1 AND l.settings:method:estimated:dayofweek LT 7"> <mvt:if expr="l.settings:method:processing:days EQ 0"> </mvt:if> <mvt:assign name="l.settings:method:processing:days" value="l.settings:method:processing:days + 1" /> </mvt:if> <mvt:if expr="l.settings:method:processing:days GT 1 AND l.settings:method:estimated:dayofweek GT 1"> <mvt:assign name="l.settings:method:shipping:days" value="l.settings:method:shipping:days + 1" /> </mvt:if> <mvt:if expr="ISNULL l.settings:method:estimated:min AND l.settings:method:shipping:days GE l.settings:method:delivery:min AND (l.settings:method:estimated:dayofweek GT 1 AND l.settings:method:estimated:dayofweek LT 7)"> <mvt:assign name="l.settings:method:estimated:min" value="l.settings:method:estimated:month $ '/' $ l.settings:method:estimated:day" /> <mvt:assign name="l.settings:method:estimated:min_day" value="l.settings:days[l.settings:method:estimated:dayofweek]:name" /> </mvt:if> <mvt:if expr="ISNULL l.settings:method:estimated:max AND l.settings:method:shipping:days GE l.settings:method:delivery:max AND (l.settings:method:estimated:dayofweek GT 1 AND l.settings:method:estimated:dayofweek LT 7)"> <mvt:assign name="l.settings:method:estimated:max" value="l.settings:method:estimated:month $ '/' $ l.settings:method:estimated:day" /> <mvt:assign name="l.settings:method:estimated:max_day" value="l.settings:days[l.settings:method:estimated:dayofweek]:name" /> <mvt:assign name="l.settings:method:delivered" value="1" /> </mvt:if> </mvt:while> </mvt:foreach> <mvt:foreach iterator="method" array="shippingmethods"> <p> <b>&mvt:method:name;</b><br> Estimated Delivery: &mvt:method:delivery:min;<mvt:if expr="l.settings:method:delivery:min NE l.settings:method:delivery:max">-&mvt:method:delivery:max;</mvt:if> business day(s)<br> Should Arrive: &mvt:method:estimated:min_day; &mvt:method:estimated:min;<mvt:if expr="l.settings:method:delivery:min NE l.settings:method:delivery:max"> to &mvt:method:estimated:max_day; &mvt:method:estimated:max;</mvt:if> </p> </mvt:foreach> <hr> </mvt:foreach>
 

Basket #11760

Get the formatted date one week from now.
Created: 1455057431
View "Basket #11760"
<mvt:eval expr="7 - 3" />
 
View "Estimated Shipping Delivery Dates"
<mvt:comment><!-- Days --></mvt:comment> <mvt:assign name="g.timezone_offset" value="'local'" /> <mvt:assign name="l.settings:days[1]:name" value="'Sunday'" /> <mvt:assign name="l.settings:days[1]:time" value="1431284400" /> <mvt:assign name="l.settings:days[2]:name" value="'Monday'" /> <mvt:assign name="l.settings:days[2]:time" value="1431370800" /> <mvt:assign name="l.settings:days[3]:name" value="'Tuesday'" /> <mvt:assign name="l.settings:days[3]:time" value="1431457200" /> <mvt:assign name="l.settings:days[4]:name" value="'Wednesday'" /> <mvt:assign name="l.settings:days[4]:time" value="1431543600" /> <mvt:assign name="l.settings:days[5]:name" value="'Thursday'" /> <mvt:assign name="l.settings:days[5]:time" value="1431630000" /> <mvt:assign name="l.settings:days[6]:name" value="'Friday'" /> <mvt:assign name="l.settings:days[6]:time" value="1431716400" /> <mvt:assign name="l.settings:days[7]:name" value="'Saturday'" /> <mvt:assign name="l.settings:days[7]:time" value="1431802800" /> <mvt:comment><!-- Shipping Methods --></mvt:comment> <mvt:assign name="l.settings:shippingmethods[1]:name" value="'Next Day'" /> <mvt:assign name="l.settings:shippingmethods[1]:delivery:min" value="1" /> <mvt:assign name="l.settings:shippingmethods[1]:delivery:max" value="1" /> <mvt:assign name="l.settings:shippingmethods[2]:name" value="'2nd Day'" /> <mvt:assign name="l.settings:shippingmethods[2]:delivery:min" value="2" /> <mvt:assign name="l.settings:shippingmethods[2]:delivery:max" value="2" /> <mvt:assign name="l.settings:shippingmethods[3]:name" value="'Ground'" /> <mvt:assign name="l.settings:shippingmethods[3]:delivery:min" value="7" /> <mvt:assign name="l.settings:shippingmethods[3]:delivery:max" value="10" /> <mvt:foreach iterator="day" array="days"> <mvt:assign name="l.settings:day:month" value="time_t_month( l.settings:day:time, g.timezone_offset )" /> <mvt:assign name="l.settings:day:day" value="time_t_dayofmonth( l.settings:day:time, g.timezone_offset )" /> <mvt:assign name="l.settings:day:formatted_date" value="l.settings:day:month $ '/' $ l.settings:day:day" /> <h2>Order Placed: &mvt:day:name; @ &mvt:day:formatted_date;</h2> <mvt:foreach iterator="method" array="shippingmethods"> <mvt:assign name="l.settings:method:elapsed:days" value="0" /> <mvt:assign name="l.settings:method:shipping:days" value="0" /> <mvt:assign name="l.settings:method:processing:days" value="0" /> <mvt:assign name="l.settings:method:delivered" value="''" /> <mvt:assign name="l.settings:method:estimated:min" value="''" /> <mvt:assign name="l.settings:method:estimated:max" value="''" /> <mvt:while expr="ISNULL l.settings:method:delivered"> <mvt:assign name="l.settings:method:counter" value="l.settings:method:counter + 1" /> <mvt:assign name="l.settings:method:elapsed:days" value="l.settings:method:elapsed:days + 1" /> <mvt:assign name="l.settings:method:elapsed:duration" value="60 * 60 * 24 * l.settings:method:elapsed:days" /> <mvt:assign name="l.settings:method:elapsed:future_time" value="l.settings:day:time + l.settings:method:elapsed:duration"/> <mvt:assign name="l.settings:method:estimated:month" value="time_t_month( l.settings:method:elapsed:future_time, g.timezone_offset )" /> <mvt:assign name="l.settings:method:estimated:day" value="time_t_dayofmonth( l.settings:method:elapsed:future_time, g.timezone_offset )" /> <mvt:assign name="l.settings:method:estimated:dayofweek" value="time_t_dayofweek( l.settings:method:elapsed:future_time, g.timezone_offset )" /> <mvt:if expr="l.settings:method:estimated:dayofweek GT 1 AND l.settings:method:estimated:dayofweek LT 7"> <mvt:if expr="l.settings:method:processing:days EQ 0"> </mvt:if> <mvt:assign name="l.settings:method:processing:days" value="l.settings:method:processing:days + 1" /> </mvt:if> <mvt:if expr="l.settings:method:processing:days GT 1 AND l.settings:method:estimated:dayofweek GT 1"> <mvt:assign name="l.settings:method:shipping:days" value="l.settings:method:shipping:days + 1" /> </mvt:if> <mvt:if expr="ISNULL l.settings:method:estimated:min AND l.settings:method:shipping:days GE l.settings:method:delivery:min AND (l.settings:method:estimated:dayofweek GT 1 AND l.settings:method:estimated:dayofweek LT 7)"> <mvt:assign name="l.settings:method:estimated:min" value="l.settings:method:estimated:month $ '/' $ l.settings:method:estimated:day" /> <mvt:assign name="l.settings:method:estimated:min_day" value="l.settings:days[l.settings:method:estimated:dayofweek]:name" /> </mvt:if> <mvt:if expr="ISNULL l.settings:method:estimated:max AND l.settings:method:shipping:days GE l.settings:method:delivery:max AND (l.settings:method:estimated:dayofweek GT 1 AND l.settings:method:estimated:dayofweek LT 7)"> <mvt:assign name="l.settings:method:estimated:max" value="l.settings:method:estimated:month $ '/' $ l.settings:method:estimated:day" /> <mvt:assign name="l.settings:method:estimated:max_day" value="l.settings:days[l.settings:method:estimated:dayofweek]:name" /> <mvt:assign name="l.settings:method:delivered" value="1" /> </mvt:if> </mvt:while> </mvt:foreach> <mvt:foreach iterator="method" array="shippingmethods"> <p> <b>&mvt:method:name;</b><br> Estimated Delivery: &mvt:method:delivery:min;<mvt:if expr="l.settings:method:delivery:min NE l.settings:method:delivery:max">-&mvt:method:delivery:max;</mvt:if> business day(s)<br> Should Arrive: &mvt:method:estimated:min_day; &mvt:method:estimated:min;<mvt:if expr="l.settings:method:delivery:min NE l.settings:method:delivery:max"> to &mvt:method:estimated:max_day; &mvt:method:estimated:max;</mvt:if> </p> </mvt:foreach> <hr> </mvt:foreach>
 
View "Estimated Shipping Delivery Dates"
<mvt:comment><!-- Days --></mvt:comment> <mvt:assign name="g.timezone_offset" value="'local'" /> <mvt:assign name="l.settings:days[1]:name" value="'Sunday'" /> <mvt:assign name="l.settings:days[1]:time" value="1431284400" /> <mvt:assign name="l.settings:days[2]:name" value="'Monday'" /> <mvt:assign name="l.settings:days[2]:time" value="1431370800" /> <mvt:assign name="l.settings:days[3]:name" value="'Tuesday'" /> <mvt:assign name="l.settings:days[3]:time" value="1431457200" /> <mvt:assign name="l.settings:days[4]:name" value="'Wednesday'" /> <mvt:assign name="l.settings:days[4]:time" value="1431543600" /> <mvt:assign name="l.settings:days[5]:name" value="'Thursday'" /> <mvt:assign name="l.settings:days[5]:time" value="1431630000" /> <mvt:assign name="l.settings:days[6]:name" value="'Friday'" /> <mvt:assign name="l.settings:days[6]:time" value="1431716400" /> <mvt:assign name="l.settings:days[7]:name" value="'Saturday'" /> <mvt:assign name="l.settings:days[7]:time" value="1431802800" /> <mvt:comment><!-- Shipping Methods --></mvt:comment> <mvt:assign name="l.settings:shippingmethods[1]:name" value="'Next Day'" /> <mvt:assign name="l.settings:shippingmethods[1]:delivery:min" value="1" /> <mvt:assign name="l.settings:shippingmethods[1]:delivery:max" value="1" /> <mvt:assign name="l.settings:shippingmethods[2]:name" value="'2nd Day'" /> <mvt:assign name="l.settings:shippingmethods[2]:delivery:min" value="2" /> <mvt:assign name="l.settings:shippingmethods[2]:delivery:max" value="2" /> <mvt:assign name="l.settings:shippingmethods[3]:name" value="'Ground'" /> <mvt:assign name="l.settings:shippingmethods[3]:delivery:min" value="7" /> <mvt:assign name="l.settings:shippingmethods[3]:delivery:max" value="10" /> <mvt:foreach iterator="day" array="days"> <mvt:assign name="l.settings:day:month" value="time_t_month( l.settings:day:time, g.timezone_offset )" /> <mvt:assign name="l.settings:day:day" value="time_t_dayofmonth( l.settings:day:time, g.timezone_offset )" /> <mvt:assign name="l.settings:day:formatted_date" value="l.settings:day:month $ '/' $ l.settings:day:day" /> <h2>Order Placed: &mvt:day:name; @ &mvt:day:formatted_date;</h2> <mvt:foreach iterator="method" array="shippingmethods"> <mvt:assign name="l.settings:method:elapsed:days" value="0" /> <mvt:assign name="l.settings:method:shipping:days" value="0" /> <mvt:assign name="l.settings:method:processing:days" value="0" /> <mvt:assign name="l.settings:method:delivered" value="''" /> <mvt:assign name="l.settings:method:estimated:min" value="''" /> <mvt:assign name="l.settings:method:estimated:max" value="''" /> <mvt:assign name="l.settings:method:counter" value="0" /> <mvt:comment> <!-- <br><br> <b>&mvt:method:name;</b><br> --> </mvt:comment> <mvt:while expr="ISNULL l.settings:method:delivered AND l.settings:method:counter LT 20"> <mvt:assign name="l.settings:method:counter" value="l.settings:method:counter + 1" /> <mvt:assign name="l.settings:method:elapsed:days" value="l.settings:method:elapsed:days + 1" /> <mvt:assign name="l.settings:method:elapsed:duration" value="60 * 60 * 24 * l.settings:method:elapsed:days" /> <mvt:assign name="l.settings:method:elapsed:future_time" value="l.settings:day:time + l.settings:method:elapsed:duration"/> <mvt:assign name="l.settings:method:estimated:month" value="time_t_month( l.settings:method:elapsed:future_time, g.timezone_offset )" /> <mvt:assign name="l.settings:method:estimated:day" value="time_t_dayofmonth( l.settings:method:elapsed:future_time, g.timezone_offset )" /> <mvt:assign name="l.settings:method:estimated:dayofweek" value="time_t_dayofweek( l.settings:method:elapsed:future_time, g.timezone_offset )" /> <mvt:if expr="l.settings:method:estimated:dayofweek GT 1 AND l.settings:method:estimated:dayofweek LT 7"> <mvt:if expr="l.settings:method:processing:days EQ 0"> <mvt:comment><!-- <mvt:eval expr="l.settings:days[l.settings:method:estimated:dayofweek]:name"/> Processing +1<br> --></mvt:comment> </mvt:if> <mvt:assign name="l.settings:method:processing:days" value="l.settings:method:processing:days + 1" /> </mvt:if> <mvt:if expr="l.settings:method:processing:days GT 1 AND l.settings:method:estimated:dayofweek GT 1"> <mvt:comment><!-- <mvt:eval expr="l.settings:days[l.settings:method:estimated:dayofweek]:name"/> Shipping +1<br> --></mvt:comment> <mvt:assign name="l.settings:method:shipping:days" value="l.settings:method:shipping:days + 1" /> </mvt:if> <mvt:if expr="ISNULL l.settings:method:estimated:min AND l.settings:method:shipping:days GE l.settings:method:delivery:min AND (l.settings:method:estimated:dayofweek GT 1 AND l.settings:method:estimated:dayofweek LT 7)"> <mvt:assign name="l.settings:method:estimated:min" value="l.settings:method:estimated:month $ '/' $ l.settings:method:estimated:day" /> <mvt:assign name="l.settings:method:estimated:min_day" value="l.settings:days[l.settings:method:estimated:dayofweek]:name" /> <mvt:comment><!-- Delivered (Min.): <mvt:eval expr="l.settings:days[l.settings:method:estimated:dayofweek]:name"/><br> --></mvt:comment> </mvt:if> <mvt:if expr="ISNULL l.settings:method:estimated:max AND l.settings:method:shipping:days GE l.settings:method:delivery:max AND (l.settings:method:estimated:dayofweek GT 1 AND l.settings:method:estimated:dayofweek LT 7)"> <mvt:assign name="l.settings:method:estimated:max" value="l.settings:method:estimated:month $ '/' $ l.settings:method:estimated:day" /> <mvt:assign name="l.settings:method:estimated:max_day" value="l.settings:days[l.settings:method:estimated:dayofweek]:name" /> <mvt:comment><!-- Delivered (Max.): <mvt:eval expr="l.settings:days[l.settings:method:estimated:dayofweek]:name"/><br> --></mvt:comment> <mvt:assign name="l.settings:method:delivered" value="1" /> </mvt:if> </mvt:while> </mvt:foreach> <mvt:foreach iterator="method" array="shippingmethods"> <p> <b>&mvt:method:name;</b><br> Estimated Delivery: &mvt:method:delivery:min;<mvt:if expr="l.settings:method:delivery:min NE l.settings:method:delivery:max">-&mvt:method:delivery:max;</mvt:if> business day(s)<br> Should Arrive: &mvt:method:estimated:min_day; &mvt:method:estimated:min;<mvt:if expr="l.settings:method:delivery:min NE l.settings:method:delivery:max"> to &mvt:method:estimated:max_day; &mvt:method:estimated:max;</mvt:if> </p> </mvt:foreach> <hr> </mvt:foreach>