Working with a json feed & trying to figure out how best to import
Good morning all, I need to be able to import a json product feed on a daily basis to update our products and stock. I am starting to write a plugin to make this work, but have a couple of questions if somebody could please advise? (I'm relatively new to Wordpress)
Here is a sample of the json I need to import:
{
"Type": "Air Pistol",
"Mechanism": "CO2",
"Calibre": "4.5mm BB",
"Make": "ASG",
"Model": "SCHOFIELD",
"Variant": "GREY",
"Origin": null,
"Orientation": "Right Handed",
"Ejection": null,
"Trigger": "0",
"BarrelLength": "0.000",
"BarrelLengthInches": null,
"BarrelLengthFraction": null,
"StockLength": "0.000",
"StockLengthInches": null,
"StockLengthFraction": null,
"WeightPounds": null,
"WeightOunces": null,
"Choke1": null,
"Choke2": null,
"ScopeMake": null,
"ScopeMag": null,
"Summary": null,
"Description": null,
"Condition": "New",
"Price": 170,
"ExpiryDate": "2019-08-10",
"ImageCount": 4,
"StockNumber": "180328/003",
"PairedGun": null,
"SerialNumber": "17J11774",
"ProofedLO": null,
"ProofedRU": null,
"Cased": null,
"Chamber": null,
"Paired": 0,
"Images": [
{
"Number": 1,
"FullPath": "https://images.guntrader.uk/GunImages/18/1803/18032/180329160440003/180329160440003-1.jpg",
"ThumbPath": "https://images.guntrader.uk/GunImages/Thumbnails/180329160440003-1-120x120.jpg"
},
{
"Number": 2,
"FullPath": "https://images.guntrader.uk/GunImages/18/1803/18032/180329160440003/180329160440003-2.jpg",
"ThumbPath": "https://images.guntrader.uk/GunImages/Thumbnails/180329160440003-2-120x120.jpg"
},
{
"Number": 3,
"FullPath": "https://images.guntrader.uk/GunImages/18/1803/18032/180329160440003/180329160440003-3.jpg",
"ThumbPath": "https://images.guntrader.uk/GunImages/Thumbnails/180329160440003-3-120x120.jpg"
},
{
"Number": 4,
"FullPath": "https://images.guntrader.uk/GunImages/18/1803/18032/180329160440003/180329160440003-4.jpg",
"ThumbPath": "https://images.guntrader.uk/GunImages/Thumbnails/180329160440003-4-120x120.jpg"
}
],
"ID": "180329160440003",
"Licence": "No Licence",
"Created": "2018-03-29 16:04:40",
"Modified": "2019-07-10 02:00:47"
},
I have created categories to match the 'Type' key in my data and attributes for all other keys, is this the right way to go about this?
How would I go about mapping these keys to the attributes, assuming that this is the correct way to do this.
Thanks in advance.
Topic woocommerce-offtopic json api Wordpress
Category Web