0
我使用的是Woocommerce Dynamic Pricing plugin,這非常有用,但不容易通過我推薦定價更新。數據庫。Woocommerce動態定價 - 手動插入定價規則
在研究樣本數據,
{"set_5339c459a78e7":
{"conditions_type":"all",
"conditions":{"1":{"type":"apply_to","args":{"applies_to":"everyone"}}},
"collector":{"type":"product"},
"mode":"block",
"date_from":"",
"date_to":"",
"rules":{"1":{"from":"","to":"","type":"price_discount","amount":""}},
"blockrules": {"1":{
"from":"2",
"adjust":"1",
"type":"fixed_adjustment",
"amount":"0.26","repeating":"yes"}}}}
似乎需要元SET_ *是具體的產品薈萃,否則將無法正確應用。
修改代碼,我注意到這一點:
$terms = get_terms('product_cat', array('hierarchical' => false, 'hide_empty' => false, 'parent' => 0));
foreach ($terms as $item_id => $item) {
$set_index = $item->term_id;
$name = 'set_' . $set_index;
}
這是奇怪的我,因爲term_id似乎比預期的BIGINT一個13個字符的字母數字字符串。任何人都可以解釋我手動更新我的表時如何重現此字符串?