I am trying to develop Wordpress plugin to integrate Erpnext with woocommerce, the problem is my Wordpress website and Erpnext in different server, so when I tried to call rest API I am getting error :
XMLHttpRequest cannot load http://xxx.xxx.x.x. No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
I tried Ajax request with JSONP but it seems it is not supported .
Could you tell me what the best practice to develop such plugin for integration.
but i get this error:
Warning: file_get_contents(http://*******/api/method/login): failed to open stream: Connection timed out in /home//public_html/test1.php on line 22
it will sync products both ways
orders from woocommerce to erpnext (If COD- it will create sales order and if paid, it will create sales invoice)
customers from woocommerce to erpnext only if the customer has placed an order in woocommerce site.