我正在寻找一个像这样的简单插件:
查看订单:添加文本字段(订单注释)
确认电子邮件模板:如果存在,请获取[order_comments]
到目前为止,我已经能够找到过于复杂的订单跟踪插件,或者仅添加WC默认注释(除非客户另有说明,否则我不想显示)。 ACF可以工作,但是我希望在这里有一个更简单的选择。
答案 0 :(得分:0)
const FundDetailList = ({data, fundID}) => {
// Don't populate index 0 with fundID, it'll get matched in the map function
const [selectedList, setSelectedList] = useState([]);
const listSelection = (i) => {
setSelectedList(
selectedList.includes(i)
? selectedList.filter(index => index !== i)
: [... selectedList, i]
);
}
return (
<FundDLWrap>
{data.map((item, i) => {
// one item must always be selected - the item ID the user came from
const selected = selectedList.includes(i) || fundID === i;
return (
<li key={i} onClick={() => listSelection(i)}>
<FundCard data={item} vertical selected={selected} />
</li>
);
})}
</FundDLWrap>
)
}
尝试此代码-仅打印客户注释。