Merge pull request #4897 from devansh-webkul/grouped-product-sort-issue
Fixed group product sort order functionality which is not working #4896
This commit is contained in:
commit
e968b331a6
|
|
@ -206,6 +206,16 @@ class ProductFlat extends Model implements ProductFlatContract
|
|||
return $this->product->grouped_products();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the grouped products by `sort_order` key that owns the product.
|
||||
*
|
||||
* @return Illuminate\Database\Eloquent\Relations\HasMany
|
||||
*/
|
||||
public function groupedProductsBySortOrder()
|
||||
{
|
||||
return $this->product->grouped_products()->orderBy('sort_order');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the bundle options that owns the product.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -2,14 +2,14 @@
|
|||
{!! view_render_event('bagisto.shop.products.view.grouped_products.before', ['product' => $product]) !!}
|
||||
|
||||
<div class="grouped-product-container">
|
||||
@if ($product->grouped_products->count())
|
||||
@if ($product->groupedProductsBySortOrder->count())
|
||||
<div class="grouped-product-list">
|
||||
<ul>
|
||||
<li>
|
||||
<span>{{ __('shop::app.products.name') }}</span>
|
||||
<span>{{ __('shop::app.products.qty') }}</span>
|
||||
</li>
|
||||
@foreach ($product->grouped_products as $groupedProduct)
|
||||
@foreach ($product->groupedProductsBySortOrder as $groupedProduct)
|
||||
@if($groupedProduct->associated_product->getTypeInstance()->isSaleable())
|
||||
<li>
|
||||
<span class="name">
|
||||
|
|
|
|||
|
|
@ -2,14 +2,14 @@
|
|||
{!! view_render_event('bagisto.shop.products.view.grouped_products.before', ['product' => $product]) !!}
|
||||
|
||||
<div class="grouped-product-container">
|
||||
@if ($product->grouped_products->count())
|
||||
@if ($product->groupedProductsBySortOrder->count())
|
||||
<div class="grouped-product-list">
|
||||
<ul type="none">
|
||||
<li>
|
||||
<span>{{ __('shop::app.products.name') }}</span>
|
||||
<span>{{ __('shop::app.products.qty') }}</span>
|
||||
</li>
|
||||
@foreach ($product->grouped_products as $groupedProduct)
|
||||
@foreach ($product->groupedProductsBySortOrder as $groupedProduct)
|
||||
@if($groupedProduct->associated_product->getTypeInstance()->isSaleable())
|
||||
<li>
|
||||
<span class="name">
|
||||
|
|
|
|||
Loading…
Reference in New Issue