Skip to content

Commit

Permalink
Fixed Boolean type attribute and attribute listing in product view
Browse files Browse the repository at this point in the history
  • Loading branch information
shivendra-webkul committed Nov 29, 2024
1 parent efa9b87 commit 4b57bb3
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,19 @@ class="flex h-[34px] items-center rounded border border-transparent transition-a
v-model="inputValue"
/>
<span class="cursor-pointer truncate rounded">
@{{ valueLabel ? valueLabel : selectedValue?.name }}
</span>
<div
class="group relative h-[18px] !w-full pl-2.5"
:style="{ 'text-align': position }"
>
<span class="cursor-pointer truncate rounded">
@{{ valueLabel ? valueLabel : options[inputValue].name }}
</span>
</div>
<template v-if="allowEdit">
<i
@click="toggle"
class="icon-edit cursor-pointer rounded text-2xl opacity-0 hover:bg-gray-200 group-hover:opacity-100 dark:hover:bg-gray-950"
class="icon-edit cursor-pointer rounded p-0.5 text-2xl opacity-0 hover:bg-gray-200 group-hover:opacity-100 dark:hover:bg-gray-950 ltr:mr-1 rtl:ml-1"
></i>
</template>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,32 @@
</h4>

{!! view_render_event('admin.products.view.attributes.view.before', ['product' => $product]) !!}

<!-- Attributes Listing -->
<div>
<!-- Default Attributes -->
<x-admin::attributes.view
:custom-attributes="app('Webkul\Attribute\Repositories\AttributeRepository')->findWhere([
'entity_type' => 'products',
['code', 'IN', ['SKU', 'price', 'quantity', 'status']]
])->sortBy('sort_order')"
:entity="$product"
:url="route('admin.products.update', $product->id)"
:allow-edit="true"
/>

<x-admin::attributes.view
:custom-attributes="app('Webkul\Attribute\Repositories\AttributeRepository')->findWhere([
'entity_type' => 'products',
['code', 'IN', ['SKU', 'price', 'quantity', 'status']]
])->sortBy('sort_order')"
:entity="$product"
:url="route('admin.products.update', $product->id)"
:allow-edit="true"
/>

<!-- Custom Attributes -->
<x-admin::attributes.view
:custom-attributes="app('Webkul\Attribute\Repositories\AttributeRepository')->findWhere([
'entity_type' => 'products',
['code', 'NOTIN', ['SKU', 'price', 'quantity', 'status']]
])->sortBy('sort_order')"
:entity="$product"
:url="route('admin.products.update', $product->id)"
:allow-edit="true"
/>
</div>

{!! view_render_event('admin.products.view.attributes.view.after', ['product' => $product]) !!}
</div>

Expand Down

0 comments on commit 4b57bb3

Please sign in to comment.