feat(catalog): add show_in_selector attribute to item attributes and update related logic
This commit is contained in:
@@ -93,6 +93,26 @@ class CatalogServiceTest extends TestCase
|
||||
}
|
||||
}
|
||||
|
||||
public function test_it_can_hide_an_item_attribute_from_the_product_selector(): void
|
||||
{
|
||||
$attribute = $this->createAttribute('internal_type');
|
||||
|
||||
$item = $this->service->create([
|
||||
'tenant_code' => $this->tenant->codigo,
|
||||
'slug' => 'hidden-attribute-item',
|
||||
'nombre' => 'Hidden attribute item',
|
||||
'precio' => 100,
|
||||
'attribute_codes' => [$attribute->codigo],
|
||||
'hidden_attribute_codes' => [$attribute->codigo],
|
||||
'variants' => [[
|
||||
'real_stock' => 5,
|
||||
'values' => [$attribute->codigo => 'internal'],
|
||||
]],
|
||||
]);
|
||||
|
||||
$this->assertFalse($item->itemAttributes->sole()->show_in_selector);
|
||||
}
|
||||
|
||||
public function test_it_allows_the_same_event_date_with_different_attribute_values(): void
|
||||
{
|
||||
$sector = $this->createAttribute('sector');
|
||||
|
||||
Reference in New Issue
Block a user