Woocommerce full 2 way integration

Hi @abrarpv97,

your error 401 is an access permission error: either the provided credentials are not correct or do not allow for read access to the specified resource.

Check your access credentials.

The termination error is then a subsequent error, because there are no pages returned (because there is no read access). Resolve the first issue and the second will be gone.

@lasalesi
Firstly I have conneccted woocommerce with erpnext woocommerce settings.then sales order and items are created in erpnext once we order through woocommerce .so it is working fine

Now I am trying with woocommerce connector(woocommerce config doctype). Here I am facing this issues

I have checked access permission it has read/write permission

API key - API consumer key
API secret - API consumer secret

Am I wrong?

If the integrated is working fine, why use the Connector? Sorry for the confusion. As far as I know the integrated module does not really work, maybe that has been improved in the meantime…

But if you get a 401 error, that is certainly an issue with the permission…

@lasalesi
erpnext does not support 2 way integration

I have SSL on the both the ERPNext and WooCommerce website, where can I find the settings for SSL verify? Also could be kind enough to do a detailed guide on how to setup properly?

Here is the traceback of the same error I am getting now even on a new instance that I just setup

Traceback (most recent call last):
File “/home/oerpadmin/frappe-bench/apps/frappe/frappe/app.py”, line 64, in application
response = frappe.api.handle()
File “/home/oerpadmin/frappe-bench/apps/frappe/frappe/api.py”, line 59, in handle
return frappe.handler.handle()
File “/home/oerpadmin/frappe-bench/apps/frappe/frappe/handler.py”, line 24, in handle
data = execute_cmd(cmd)
File “/home/oerpadmin/frappe-bench/apps/frappe/frappe/handler.py”, line 64, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/oerpadmin/frappe-bench/apps/frappe/frappe/init.py”, line 1064, in call
return fn(*args, **newargs)
File “/home/oerpadmin/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 21, in savedocs
doc.save()
File “/home/oerpadmin/frappe-bench/apps/frappe/frappe/model/document.py”, line 273, in save
return self._save(*args, **kwargs)
File “/home/oerpadmin/frappe-bench/apps/frappe/frappe/model/document.py”, line 309, in _save
self.run_before_save_methods()
File “/home/oerpadmin/frappe-bench/apps/frappe/frappe/model/document.py”, line 896, in run_before_save_methods
self.run_method(“validate”)
File “/home/oerpadmin/frappe-bench/apps/frappe/frappe/model/document.py”, line 797, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/oerpadmin/frappe-bench/apps/frappe/frappe/model/document.py”, line 1073, in composer
return composed(self, method, *args, **kwargs)
File “/home/oerpadmin/frappe-bench/apps/frappe/frappe/model/document.py”, line 1056, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/oerpadmin/frappe-bench/apps/frappe/frappe/model/document.py”, line 791, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/oerpadmin/frappe-bench/apps/woocommerceconnector/woocommerceconnector/woocommerceconnector/doctype/woocommerce_config/woocommerce_config.py”, line 17, in validate
self.validate_access()
File “/home/oerpadmin/frappe-bench/apps/woocommerceconnector/woocommerceconnector/woocommerceconnector/doctype/woocommerce_config/woocommerce_config.py”, line 27, in validate_access
“api_secret”: self.get_password(fieldname=‘api_secret’,raise_exception=False), “woocommerce_url”: self.woocommerce_url, “verify_ssl”: self.verify_ssl})
File “/home/oerpadmin/frappe-bench/apps/woocommerceconnector/woocommerceconnector/woocommerce_requests.py”, line 61, in get_request
return get_request_request(path, settings).json()
File “/home/oerpadmin/frappe-bench/apps/woocommerceconnector/woocommerceconnector/woocommerce_requests.py”, line 55, in get_request_request
message=“{0}: {1}”.format(r.url, r.json()),
File “/home/oerpadmin/frappe-bench/env/lib/python3.6/site-packages/requests/models.py”, line 897, in json
return complexjson.loads(self.text, **kwargs)
File “/usr/lib/python3.6/json/init.py”, line 354, in loads
return _default_decoder.decode(s)
File “/usr/lib/python3.6/json/decoder.py”, line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “/usr/lib/python3.6/json/decoder.py”, line 357, in raw_decode
raise JSONDecodeError(“Expecting value”, s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Thanks.

You will find install instructions on Home · libracore/WooCommerceConnector Wiki · GitHub of course they can still be improved :wink:

Your error comes from validate_access > get_request_path which yields an error for an invalid json content… You will find an option to verify_ssl in the WooCommerce Config, what happens if you try the other setting of that?

Hello @lasalesi is a similar issue as the last post …but i can’t find verify_ssl any where on the config settings.

Hi to all, I see this thread is still active.

Could anyone have a look on this issue:

There might be a problem with accounting if syncing invoices fails due to a reason.

Hello Man,

Thank you very much for your help, I have successfully setup and save the WooCommerce config settings. The new challenge I am having now is that the sync error keeps saying WooCommerce ID is missing for products selected to sync to the WooCommerce site. The question I have now is that am I supposed to create the product again in WooCommerce to have WooCommerce ID??? I downloaded the item list and found columns for woocommerce_id and woocommmerce_product_id, I even manually filled the values in and did a manual sync. The sync was successful but products aren’t showing up in WooCommerce Site.

I have checked everything but still cant figure out why products wont show after sync was successfully completed. Please help.

Thanks.

Hi @iamholukay,

in WooCommerce, any product automatically gets a WooCommerce-ID (their database key, numerical value), in order to identify it. This has to be matched against your Item records. You can either have this synced automatically (refer to the “sync ids” button in the config), if items are created from the sync this will also automatically be mapped. If none of these options suit you well, you can always add the WooCommerce ID value using the data import tool…

Hope that helps.

Hi @lasalesi,

Happy New Year to you and your family, once again thank you so much for all your help with this plugin. I really appreciate it.

About your latest reply I understand perfectly what you meant. I know products in WooCommerce gets an ID automatically once created. My question in the previous reply is yet to be answered, let explain better.

So I have 700 products in my ERP Next instance that I am trying to connect to a WooCommerce store. These products already have all the necessary information in ERP Next. Now before the sync will work? Do I have to go over to my WooCommerce store and recreate the products all over again one after? before I can get a WooCommerce ID for them? That is what I need clarification on.

Thank you once again.

Hey, seems like a great solution and first setup is working for me. Can you explain the working? Is traffic going via Libracore servers? Or is it a direct connection between ERPNext and the hosted WordPress/Woocommerce instances?

Hi @iamholukay,

thanks for your kind words!

If you have products in ERPNext and WooCommerce, the Sync IDs function should help to align the two systems. It uses the SKU/barcode to match products from the two systems, as WooCommerce uses automatically increased numbers as keys and ERPNext the name (item_code). You can also manually match the products by inserting the corresponding WooCommerceID in this field on “Item” (use the data import tool).

As soon as the items are matched, you can sync. If you enable items from ERPNext to WooCommerce, marked items will be uploaded and with create items in ERPNext vice versa. Hope this works for you.

1 Like

Hi @ServusNL,

it works by ERPNext connecting directly to the WooCommerce REST API. There are no third-party servers involved.

That’s great thanks. I’m encountering on error with the items import, it says “could not find Default Unit of Measure: Nos”. It imported one product for a part. After the error, I added “Nos” to UOM. But in following syncs it does not find any new products. There is no way in retrying the sync.

I rolled back to my clean install, made sure te UOM were added and now the sync was successful. It does not sync the image however. Is this not part of the functionality or am I doing something wrong? Thanks in advance!

I tried the Woocommerce add on again on a fresh installation of NextERP but not a single product is synchronising. I see this status and that’s all:

No errors but also not a single product.

What’s going wrong here?

You are missing sync ids (this is in ERPNext the field WooCommerce Product ID) which allow to map ERPNext items to WooCommerce items. Either use “Sync IDs” or manually map the products…

1 Like

Hi all!

Just came accross this discussion, and its quite a lengthy one so I kinda got lost in the information on here. From what I learnt, @lasalesi provided a plugin: https://github.com/libracore/WooCommerceConnector/ to enable the 2-way sync.

My question is, is this still required or the default WooCommerce integration that comes with newer versions of ERPNext has this covered? If not, Can the maintainers of the plugin put the compatible ERPNext versions on the plugin’s readme?

Regards,
Redgren

My understanding is that you need to use either of the two. The core version doesn’t have 2 way synchronization. It only makes Sales Order and not Sales Invoice. Haven’t tested either of the methods but have been following various threads. Good luck.

1 Like