Add exports & fix on edition

This commit is contained in:
Ludovic CANDELLIER
2020-08-03 23:09:26 +02:00
parent 1e685cfefb
commit b7d03fc5c4
28 changed files with 190 additions and 136 deletions

View File

@@ -39,11 +39,15 @@ class ArticlePrices
return ArticlePrice::find($id);
}
public static function storePrices($article_attribute_id, $prices)
public static function storePrices($article_id, $prices)
{
if ($prices) {
foreach ($prices as $key => $price) {
$prices[$key]['article_attribute_id'] = $article_attribute_id;
$price['article_attribute']['article_attribute_value_id'] = $price['attribute']['attribute_value_id'];
$prices[$key]['article_attribute_id'] = ArticleAttributes::storeAttribute($article_id, $price['article_attribute']);
unset($prices[$key]['article_attribute']);
unset($prices[$key]['attribute']);
self::store($prices[$key]);
}
} else {