WooCommerce - WooSquare Plus plugin - plus product variations must be an array

寵の児 提交于 2020-02-08 02:32:25

问题


WooSquare plugin failed to synchronize products between WooCommerce and Square.


回答1:


I had a look at the contents of the xxxx_woo_square_integration_logs table in the WordPress database. One of the log entries said - "variations must be an array". I had a brief look at the program that I thought was performing the synchronization, WooToSquareSynchronizer.php and it had a statement:

$product_variations = unserialize($productDetails['_product_attributes'][0]);

Despite variations having another meaning in WooCommerce, the code appears to suggest what we are talking about here is product attributes. I guessed that the code expects at least one attribute for each product. I added a single global attribute and then set that on each of my products. My products were then successfully synchronized. Note that this failure only occurred when creating products, not when updating products. Looking at the WooSquare plus documentation, product variations looked to managed with attributes but in my case, I was not using product variations.

P.S. Could someone with 1500 reputation please add "WooSquare plus" as a tag?

References:

https://apiexperts.io/documentation/woosquare-plus/ (NOT TO BE CONFUSED WITH WooSquare Pro!).

https://apiexperts.io/fast-support/

This is probably the free version - https://wordpress.org/support/plugin/woosquare/reviews/ - https://apiexperts.io/documentation/woosquare/



来源:https://stackoverflow.com/questions/60087430/woocommerce-woosquare-plus-plugin-plus-product-variations-must-be-an-array

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!