dvdl16 / woocommerce_fusion

WooCommerce connector for ERPNext v15
https://finfoot.tech
GNU General Public License v3.0
29 stars 24 forks source link

Support JSONPath or Mustache in Item Fields Mapping #103

Open dvdl16 opened 4 months ago

dvdl16 commented 4 months ago

Is your feature request related to a problem? Please describe.

I want to synchronise the Product Image field between WooCommerce and ERPNext. This means image on Item and images on WooCommerce Product. But, the images field is a json list, so it won't work to map the fields values directly.

Describe the solution you'd like

Support JSONPath or Mustache on WooCommerce Server > Items tab > Item Fields > Fields Mapping

Then I can map it like $.images[0].src, which will sync the first image's src value to the Item image field, like so:

image

Describe alternatives you've considered

Manually update images between sites - very tedious

Additional context

Example of WooCommerce images field:

[
    {
        "id": 14449,
        "date_created": "2023-11-17T17:44:18",
        "date_created_gmt": "2023-11-17T13:44:18",
        "date_modified": "2024-03-10T02:05:52",
        "date_modified_gmt": "2024-03-09T22:05:52",
        "src": "https://some-site.com/wp-content/uploads/2023/12/image-description.webp",
        "name": "image-description",
        "alt": ""
    }
]
dvdl16 commented 4 months ago

This will also be helpful if someone wants to sync values from a WooCommerce Product's meta_data field to a field on Item