Miva - Shipping Delivery Estimates
<mvt:if expr="'Next Day' CIN l.settings:method:name">
<mvt:assign name="l.settings:method:delivery:min" value="1" />
<mvt:assign name="l.settings:method:delivery:max" value="2" />
<mvt:elseif expr="'2nd Day' CIN l.settings:method:name">
<mvt:assign name="l.settings:method:delivery:min" value="2" />
<mvt:assign name="l.settings:method:delivery:max" value="3" />
<mvt:elseif expr="'Ground' CIN l.settings:method:name OR 'Free Shipping' CIN l.settings:method:name">
<mvt:assign name="l.settings:method:delivery:min" value="7" />
<mvt:assign name="l.settings:method:delivery:max" value="10" />
</mvt:if>
<mvt:if expr="l.settings:method:delivery:min">
<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="s.dyn_time_t + 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="s.dyn_tm_hour LT 12">
<mvt:assign name="l.settings:method:processing:days" value="l.settings:method:processing:days + 1" />
</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:method:estimated:min_day; &mvt:method:estimated:min; - &mvt:method:estimated:max_day; &mvt:method:estimated:max; -->
</mvt:if>