cek brand shipment
This commit is contained in:
parent
ed6fb21bd5
commit
035f379c26
|
|
@ -72,12 +72,14 @@ class Products extends ProductController
|
|||
}
|
||||
|
||||
public function newProducts(){
|
||||
$products = $this->getRepositoryInstance()->getNewProducts();
|
||||
$count = core()->getConfigData('catalog.products.homepage.no_of_featured_product_homepage');
|
||||
$products = $this->getRepositoryInstance()->getNewProducts(10);
|
||||
return $this->getResourceCollection($products);
|
||||
}
|
||||
|
||||
public function featuredProducts(){
|
||||
$products = $this->getRepositoryInstance()->getFeaturedProducts();
|
||||
|
||||
$products = $this->getRepositoryInstance()->getFeaturedProducts(10);
|
||||
return $this->getResourceCollection($products);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,8 +17,7 @@ class Slider extends JsonResource
|
|||
return [
|
||||
'id' => $this->id,
|
||||
'title' => $this->title,
|
||||
// 'image_url' => $this->mobile_image_url,
|
||||
// 'mobile_url' => $this->image_url,
|
||||
'image_url' => $this->mobile_image_url,
|
||||
'content' => $this->content,
|
||||
'expired_at'=> $this->expired_at,
|
||||
'sort_order'=> $this->sort_order,
|
||||
|
|
|
|||
|
|
@ -442,10 +442,8 @@ class ProductRepository extends PRepository
|
|||
*
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
public function getNewProducts()
|
||||
public function getNewProducts($count = 5)
|
||||
{
|
||||
$count = core()->getConfigData('catalog.products.homepage.no_of_new_product_homepage');
|
||||
|
||||
$results = app(ProductFlatRepository::class)->scopeQuery(function ($query) {
|
||||
$channel = core()->getRequestedChannelCode();
|
||||
|
||||
|
|
@ -467,7 +465,7 @@ class ProductRepository extends PRepository
|
|||
|
||||
return $qb->inRandomOrder();
|
||||
|
||||
})->paginate($count ? $count : 5);
|
||||
})->paginate($count);
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
|
@ -476,9 +474,8 @@ class ProductRepository extends PRepository
|
|||
*
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
public function getFeaturedProducts()
|
||||
public function getFeaturedProducts($count = 5)
|
||||
{
|
||||
$count = core()->getConfigData('catalog.products.homepage.no_of_featured_product_homepage');
|
||||
|
||||
$results = app(ProductFlatRepository::class)->scopeQuery(function ($query) {
|
||||
$channel = core()->getRequestedChannelCode();
|
||||
|
|
@ -499,7 +496,7 @@ class ProductRepository extends PRepository
|
|||
}
|
||||
|
||||
return $qb->inRandomOrder();
|
||||
})->paginate($count ? $count : 5);
|
||||
})->paginate($count);
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
@if ($featured_products = app('TPS\Shop\Repositories\ProductRepository')->getFeaturedProducts())
|
||||
|
||||
@if ($featured_products = app('TPS\Shop\Repositories\ProductRepository')->getFeaturedProducts($count))
|
||||
<div class="item-gallery-inner">
|
||||
<div class="item-gallery-title">
|
||||
<h2>{{__('shop::app.home.featured-products')}}</h2>
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
$metaKeywords = $homeSEO->meta_keywords;
|
||||
}
|
||||
$count = core()->getConfigData('catalog.products.homepage.no_of_featured_product_homepage');
|
||||
@endphp
|
||||
|
||||
@section('page_title')
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
@if ($new_products = app('TPS\Shop\Repositories\ProductRepository')->getNewProducts())
|
||||
@if ($new_products = app('TPS\Shop\Repositories\ProductRepository')->getNewProducts($count))
|
||||
<div class="item-gallery-inner">
|
||||
<div class="item-gallery-title">
|
||||
<h2>{{__('shop::app.home.new-products')}}</h2>
|
||||
|
|
|
|||
Loading…
Reference in New Issue