diff --git a/resources/js/stores/useAttributes.js b/resources/js/stores/useAttributes.js index e16ef9b6a..08c7d45db 100644 --- a/resources/js/stores/useAttributes.js +++ b/resources/js/stores/useAttributes.js @@ -38,8 +38,12 @@ export const attributes = computedAsync( { lazy: true, shallow: false }, ) -window.attributeLabel = computed((attributeCode) => { - return Object.values(attributes.value)?.find((attribute) => attribute.code === attributeCode)?.name -}) +window.attributeLabel = (attributeCode) => { + return computed( + () => + Object.values(attributes.value)?.find((attribute) => attribute.code === attributeCode)?.name ?? + attributeCode.replaceAll(/[_-]/g, ' '), + ) +} export default () => attributes diff --git a/resources/views/cart/item.blade.php b/resources/views/cart/item.blade.php index 34db0db5d..d0e3d388b 100644 --- a/resources/views/cart/item.blade.php +++ b/resources/views/cart/item.blade.php @@ -27,7 +27,7 @@ class="mx-auto"
@include('rapidez::cart.item.remove')