admin管理员组文章数量:1336346
I'm trying to update a WooCommerce product entry with data from an API, where the values from the API match taxonomy terms I've created in my WordPress site.
For most fields this works, but I have one attribute that can contain multiple terms. Using update_post_meta
I'm adding these, imploded to a string seperated by |
.
$meta[] = array(
'key' => 'pa_aantal_spelers',
'value' => implode($players, ' | '),
'visible' => 1,
);
When I view the product in the dashboard, the attribute looks good but the values aren't interpreted correctly on the front-end on the site. When I then save the product, with the piped string as the attribute value, the value is set correctly.
Any advice on how I should be setting these multiple terms in the product attribute?
Thanks
本文标签: pluginsAdd multiple attributes to product from php
版权声明:本文标题:plugins - Add multiple attributes to product from php 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742356863a2459585.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论