WP所有导入功能以处理序列化数组数据
I am using a multi inventory plug-in to store stock levels of products in Woocommerce between 3 locations - they are named 754, 753 and 752
They are stored in database in a serialised array like this:
Key: woocommerce_multi_inventory_inventories_stock
Value: a:3: {i:754; s:0:“ 5”; i:753; s:0:“ 5”; i:752; s:0:“ 5”:“ 5”;}
我试图使用WP所有导入量导入库存级别仅进入这些位置中的1个 - 754,然后离开其他两个。 WP所有导入都可以导入到该序列化数组中,但是当它更改754时,它会覆盖其他两个位置。
任何人是否知道与WP一起使用的php函数是如何在754中仅更改股票水平而不调整其他2的股票水平?
I am using a multi inventory plug-in to store stock levels of products in Woocommerce between 3 locations - they are named 754, 753 and 752
They are stored in database in a serialised array like this:
Key: woocommerce_multi_inventory_inventories_stock
Value: a:3:{i:754;s:0:”5”;i:753;s:0:”5”;i:752;s:0:”5”;}
I am trying to use WP All Import to import stock levels into just 1 of these locations - 754 and leave the other two as they are. WP All Import can import into this serialised array but it then overrides the other 2 locations when it changes 754.
Would anyone know how a php function to use with WP All Import in order to change ONLY the stock level in 754 without adjusting the other 2?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
https:///www.codegrepper.com/code-com/code-com/code-com/code-com/code-com/code-com/code-com/示例/php/php+serialize+to+array+在线
使用上述方法,您可以使用WP All Import Optoct中的“可用键”为自定义字段创建序列化数据。
序列化数组的说明如下:
如果您仍然对“二级输出”感到好奇,它相当简单:a = array,3 = {}}中三个元素的大小。在其中,您的i =整数/索引等于1,len 6等于“ elem 1”,整数等于2 ..等等。当您这样阅读时,它相当清楚。您可以想象在内部容易包含多个级别的数组/对象,但是修改非常不明智,您应该真正不进行修改,然后序列化以确保一致性。
在这里,您可以找到更多详细信息:
url:如何使用php serialize() ()
https://www.codegrepper.com/code-examples/php/php+serialize+to+array+online
Using the above method you can create serialize data for the custom field using the key available in wp all import options.
Explanation of serialize array is as follows:
In case you were still curious about the "secondary output", its fairly simple: a = array, 3 = of size three elements within the {}'s. inside that, you have i=integer/index equalling 1, string of len 6 equalling "elem 1", integer equalling 2.. etc etc.. Its fairly clear when you read it like that. You can imagine multiple levels of arrays/objects being easily contained within, however modification is very unwise, you should really unserialize modify then serialize to ensure consistency.
Here you can find more details:
URL: How to use php serialize() and unserialize()