Fix $weight_impact $price_impact
This commit is contained in:
parent
5a3f78088e
commit
1bc8c57d6d
@ -1347,10 +1347,13 @@ class Products extends DolibarrApi
|
|||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($id) || empty($weight_impact) || empty($price_impact) || empty($features) || !is_array($features)) {
|
if (empty($id) || empty($features) || !is_array($features)) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$weight_impact = price2num($weight_impact);
|
||||||
|
$price_impact = price2num($price_impact);
|
||||||
|
|
||||||
$prodattr = new ProductAttribute($this->db);
|
$prodattr = new ProductAttribute($this->db);
|
||||||
$prodattr_val = new ProductAttributeValue($this->db);
|
$prodattr_val = new ProductAttributeValue($this->db);
|
||||||
foreach ($features as $id_attr => $id_value) {
|
foreach ($features as $id_attr => $id_value) {
|
||||||
@ -1406,10 +1409,13 @@ class Products extends DolibarrApi
|
|||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($ref) || empty($weight_impact) || empty($price_impact) || empty($features) || !is_array($features)) {
|
if (empty($ref) || empty($features) || !is_array($features)) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$weight_impact = price2num($weight_impact);
|
||||||
|
$price_impact = price2num($price_impact);
|
||||||
|
|
||||||
$prodattr = new ProductAttribute($this->db);
|
$prodattr = new ProductAttribute($this->db);
|
||||||
$prodattr_val = new ProductAttributeValue($this->db);
|
$prodattr_val = new ProductAttributeValue($this->db);
|
||||||
foreach ($features as $id_attr => $id_value) {
|
foreach ($features as $id_attr => $id_value) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user