Variable product feature does not work

Laraship QuestionsCategory: TechnicalVariable product feature does not work
Mohammad sayed asked 4 years ago
Hello, We encountered a bug in with adding a variable product (SKU Options are not saving in data base)
laraship Staff replied 4 years ago

Hello Mohammad, to be able to help please provide is with the following:

1) steps to reproduce the issue
2) screenshots of the errors
3) log file under storage/log/laravel.log

Thanks

Mohammad sayed replied 4 years ago

nothing in log file

Mohammad sayed replied 4 years ago

I think the error is in this function
Corals/modules/Ecommerce/Http/Controllers/SKUController.php

protected function createOptions($request, $sku)
{
$sku->options()->delete();

$options = [];
if (isset($request->options)) {
foreach ($request->options as $key => $value) {
if (is_array($value)) {
foreach ($value as $value_option) {
$options[] = [
‘attribute_id’ => $key,
‘value’ => $value_option
];
}
} else {
$options[] = [
‘attribute_id’ => $key,
‘value’ => $value
];
}
}

$sku->options()->createMany($options);
}

}

because there is no column called value

2 Answers
Best Answer
laraship Staff answered 4 years ago
Hello, The issue is fixed now, its due to a bug in the latest Laravel update and we did a workaround to, please update the foundation module to 5.2 Best Regards.  
Mohammad sayed replied 4 years ago

It is working well now, Thank you

laraship Staff answered 4 years ago
Hello, Our team is looking at, however regarding your note about column value, this variable is dynamic, see
public function setValueAttribute($value) 

at Corals/modules/Ecommerce/Models/SKUOption.php