lunar
lunar copied to clipboard
Bugfix issue 254: Make identifier nullable on product variant and order line
This PR solves the issue reported in https://github.com/lunarphp/lunar/issues/254. It is not an ideal fix, but this way it will not throw an exception anymore. Ideally the config from the admin package and the core package would share the product identifiers, the ones shown below:
'sku' => [
'required' => true,
'unique' => true,
],
'gtin' => [
'required' => false,
'unique' => false,
],
'mpn' => [
'required' => false,
'unique' => false,
],
'ean' => [
'required' => false,
'unique' => false,
],
This way we could return the corresponding identifier in the getIdentifier()
method on ProductVariant
instead of doing the following (which is not fool proof):
public function getIdentifier()
{
return $this->sku ?? $this->gtin ?? $this->mpn ?? $this->ean ?? null;
}
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
lunar-docs | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Sep 20, 2023 7:28pm |
Thanks @fmeccanici I agree it needs addressing but this isn't like they correct approach. I will convert to draft for the moment and then we can revisit with @glennjacobs
Closing as this PR has had a status of "Draft" for a long time and our focus is now moving to 1.x with Filament admin panel.