|
@@ -200,37 +200,17 @@ class ProductController extends Controller
|
|
|
|
|
|
public function uploadValAttribute(Request $request)
|
|
|
{
|
|
|
+ $attributes=Attribute::orderBy('title')->get();
|
|
|
$productID = $request->productID;
|
|
|
|
|
|
$product = Product::where('id', $productID)->first();
|
|
|
$attributes = [];
|
|
|
- foreach ( [$request->val_attribute] as $attr_id => $values ){
|
|
|
+ foreach ( $request->val_attribute as $attr_id => $values ){
|
|
|
$attributes[ $attr_id ] = ['val_attribute' => $values];
|
|
|
|
|
|
}
|
|
|
-
|
|
|
- $product->attributes()->sync($attributes);
|
|
|
-dd($attributes);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+ $product->attributes()->sync($attributes);
|
|
|
+
|
|
|
}
|
|
|
}
|