Update product data - celdotro/marketplace GitHub Wiki
- Updates a product's data
- Can't update pretf and pretlei in the same time
- (pret_promo, start, end) form a tuple, therefore if a field is specified, the rest, that aren't yet stored in the database, are mandatory
celmarket\Products\ProductsUpdate
saveProducts
- method: products
- action: saveProducts
Fields written in bold are mandatory
- products = array with products as sub-array -> array
- (array element) = product -> array
- model = product's model
- pretf = supplier's price (only if pretlei wasn't supplied)
- pretlei = RON price (only if pretf wasn't supplied)
- status = product's status
- pret_vechi = old price
- pret_promo = promotional price (must be greater than 0)
- start = start date for special price (must be smaller than end)
- end = end date for special price (must be greater than start)
- garantie = duration of warranty in months
- garantie_pj = duration of warranty for companies in months
- data_minima = minimum date since when the product is available
- stoc = product's quantity
- (array element) = product -> array
An object with the following attributes
- updated = updated products -> array
- (array element) = product's model
- notUpdated = products that haven't been modified -> array
- (array element) = product's model
- exceptions = products that threw Exceptions -> array
- (array element) = product's model
- error = products that were not used in a query -> array
- (array element) = product's model
https://github.com/celdotro/marketplace_examples/blob/master/Products/7.UpdateData.php
{
"request": {
"0": {
"model": "X",
"pretf": 1,
"moneda": "X",
"status": 1,
"adaos": 1,
"bonus": 1,
"pret_vechi": 1,
"pret_promo": 1,
"start": "01-01-2018",
"end": "01-01-2018",
"hasTVA": true,
"garantie": 1,
"garantie_pj": 1,
"data_minima": "01-01-2018",
"stoc": 1
},
"1": {
"model": "X",
"pretlei": 1,
"moneda": "X",
"status": 1,
"adaos": 1,
"bonus": 1,
"pret_vechi": 1,
"pret_promo": 1,
"start": "01-01-2018",
"end": "01-01-2018",
"hasTVA": true,
"garantie": 1,
"garantie_pj": 1,
"data_minima": "01-01-2018",
"stoc": 1
}
},
"response": {
"updated": [
"X"
],
"notUpdated": [
"X"
],
"exceptions": [
"X"
],
"error": [
"X"
]
}
}