More feasible IMO would be to develop some sort of nightly data import routine that copies the POS data and translates it into WP post types that WC can understand. You wouldn’t be out of sync for more than 24 hours and most data would likely remain valid. You could not get “simple columns” this way, but you also do not need to rewrite WC.
]]>But could you elaborate more on
]]>More feasible IMO would be to develop some sort of nightly data import routine that copies the POS data and translates it into WP post types that WC can understand.
This would still entail a lot of custom coding, but IMO it’s much preferable to rewriting WC to work directly off the POS data.
]]>Below is WooCommerce’s REST API documentation:
https://woocommerce.github.io/woocommerce-rest-api-docs/
You can build an intermediary app in php, node, etc to pull your data and push it to WooCommerce with REST and JSON
An example would be as below for a batch update:
Note: You would of course have to code “pulling” your data into a json format that suits “pushing” and is beyond the scope of what I’m trying to explain. This is by no means an exhaustive tutorial. Hope it gives you an idea on how to get started. I’m still figuring this out myself! ??
Source: WooCommerce – Batch Update Products – REST
<?php
$data = [
'create' => [
[
'name' => 'Woo Single #1',
'type' => 'simple',
'regular_price' => '21.99',
'virtual' => true,
'downloadable' => true,
'downloads' => [
[
'name' => 'Woo Single',
'file' => 'https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_angle.jpg'
]
],
'categories' => [
[
'id' => 11
],
[
'id' => 13
]
],
'images' => [
[
'src' => 'https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_angle.jpg'
]
]
],
[
'name' => 'New Premium Quality',
'type' => 'simple',
'regular_price' => '21.99',
'description' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.',
'short_description' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.',
'categories' => [
[
'id' => 9
],
[
'id' => 14
]
],
'images' => [
[
'src' => 'https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg'
],
[
'src' => 'https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg'
]
]
]
],
'update' => [
[
'id' => 799,
'default_attributes' => [
[
'id' => 6,
'name' => 'Color,
'option' => 'Green'
],
[
'id' => 0,
'name' => 'Size',
'option' => 'M'
]
]
]
],
'delete' => [
794
]
];
print_r($woocommerce->post('products/batch', $data));
?>
]]>