xml 自动将商品放入延期交货(正在进行中 - mayajewelry)
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了xml 自动将商品放入延期交货(正在进行中 - mayajewelry)相关的知识,希望对你有一定的参考价值。
<mvt:item name="toolkit" param="sassign|backorder_live|true|" />
<mvt:comment>
| Months
</mvt:comment>
<mvt:assign name="l.settings:months[1]" value="'January'" />
<mvt:assign name="l.settings:months[2]" value="'February'" />
<mvt:assign name="l.settings:months[3]" value="'March'" />
<mvt:assign name="l.settings:months[4]" value="'April'" />
<mvt:assign name="l.settings:months[5]" value="'May'" />
<mvt:assign name="l.settings:months[6]" value="'June'" />
<mvt:assign name="l.settings:months[7]" value="'July'" />
<mvt:assign name="l.settings:months[8]" value="'August'" />
<mvt:assign name="l.settings:months[9]" value="'September'" />
<mvt:assign name="l.settings:months[10]" value="'October'" />
<mvt:assign name="l.settings:months[11]" value="'November'" />
<mvt:assign name="l.settings:months[12]" value="'December'" />
<mvt:comment>
| Current Date + 49 days (7 weeks)
</mvt:comment>
<mvt:assign name="l.settings:prior_t" value="(mktime_t( s.tm_year, s.tm_mon, s.tm_mday, 0, 0, 0, g.Merchant_Local_Timezone ) - ( ( l.settings:days - 1 ) * 86400 ) - 43200) + (49 * 24 * 60 * 60)" />
<mvt:assign name="l.settings:prior_year" value="time_t_year( l.settings:prior_t, g.Merchant_Local_Timezone )" />
<mvt:assign name="l.settings:prior_month" value="time_t_month( l.settings:prior_t, g.Merchant_Local_Timezone )" />
<mvt:assign name="l.settings:prior_day" value="time_t_dayofmonth( l.settings:prior_t, g.Merchant_Local_Timezone )" />
<mvt:assign name="backordertimestamp" value="mktime_t( l.settings:prior_year, l.settings:prior_month, l.settings:prior_day, 0, 0, 0, g.Merchant_Local_Timezone )" />
<mvt:assign name="g.backorder_date_numeric" value="l.settings:prior_month $ '/' $ l.settings:prior_day $ '/' $ l.settings:prior_year" />
<mvt:assign name="g.backorder_date_text" value="l.settings:months[l.settings:prior_month] $ ' ' $ l.settings:prior_day" />
<mvt:comment>
| Set up a page called backorder date, and call the date in with page render
| Variable set at top, for example on dev store.
</mvt:comment>
<mvt:assign name="overallBackInStock" value="'05-20-2015'" />
<mvt:assign name="obisMonth" value="gettoken( g.overallBackInStock, '-', 1 )" />
<mvt:assign name="obisDay" value="gettoken( g.overallBackInStock, '-', 2 )" />
<mvt:assign name="obisYear" value="gettoken( g.overallBackInStock, '-', 3 )" />
<mvt:assign name="obackInStockTime" value="mktime_t(g.obisYear, g.obisMonth, g.obisDay,0,0,0,local)" />
Screenshot: http://puu.sh/hiSDd/c0d799e4c3.jpg
- Make sure "track out of stock levels" is not being tracked in inventory settings (can be a per-product basis)
- check if there are no parts (?), and if not check inventory for that product.
<mvt:eval expr="mktime_t( s.tm_year, s.tm_mon, s.tm_mday, 0, 0, 0, local ) + 4233600" /> // 49 days (7 weeks)
<mvt:comment>
| Add at the end of the INVC, or somewhere outside the loop
| Need to add datetime
| If it's an overall date (every product) use the following:
</mvt:comment>
<mvt:do name="l.settings:backorderedItems" file="g.Module_Library_DB" value="OrderItemList_BackOrder(l.settings:order:id, l.settings:orderitemarraylength, l.settings:orderitemarray, g.obackInStockTime)" />
<mvt:comment>
| If it's product/ variant specific, use the following.
| Instock_dates needs to be an array -- use a customfield and insert into array of dates, corresponding with the product. If there's no date in the customfield, use overall?
</mvt:comment>
<mvt:do name="l.settings:backorderedItems" file="g.Module_Library_DB" value="OrderItemList_BackOrder_Dates(l.settings:order:id, l.settings:orderitemarraylength, l.settings:orderitemarray, l.settings:instock_dates)" />
<mvt:comment>
| Add inside items loop, where you want Backordered to show
| Uses customfield: back_in_stock on a per-product basis, if it's not filled out, uses the global variable
</mvt:comment>
<mvt:assign name="l.settings:orderitemarraylength" value="0" />
<mvt:foreach iterator="part" array="item:parts">
<mvt:if expr="l.settings:part:inv_available LT 0">
<p><em>Backordered until
<mvt:assign name="l.settings:orderitemarraylength" value="miva_array_insert( l.settings:orderitemarray, l.settings:item, -1 )" />
<mvt:item name="customfields" param="Read_Product_Code( l.settings:part:code, 'back_in_stock', l.settings:back_in_stock )" />
<mvt:if expr="l.settings:back_in_stock">
<mvt:assign name="bisMonth" value="gettoken( l.settings:back_in_stock, '-', 1 )" />
<mvt:assign name="bisDay" value="gettoken( l.settings:back_in_stock, '-', 2 )" />
<mvt:assign name="bisYear" value="gettoken( l.settings:back_in_stock, '-', 3 )" />
<mvt:assign name="backInStockTime" value="mktime_t(g.bisYear, g.bisMonth, g.bisDay,0,0,0,local)" />
<mvt:assign name="stockdatescount" value="miva_array_insert(l.settings:instock_dates, g.backInStockTime, -1)" />
&mvt:back_in_stock;
<mvt:else>
<mvt:assign name="stockdatescount" value="miva_array_insert(l.settings:instock_dates, g.obackInStockTime, -1)" />
&mvt:global:overallBackInStock;
</mvt:if>
</em></p>
</mvt:if>
</mvt:foreach>
以上是关于xml 自动将商品放入延期交货(正在进行中 - mayajewelry)的主要内容,如果未能解决你的问题,请参考以下文章
有没有办法在 Netsuite 高级 PDF 装箱单 (freemarker) 上显示延期交货的商品?