From ce23e7c99a041c0827e9528fd4b3941d8da8bb56 Mon Sep 17 00:00:00 2001 From: Kerim Date: Tue, 27 Jun 2023 03:08:01 +0500 Subject: [PATCH] brand --- .../src/Repositories/ProductRepository.php | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/Sarga/Shop/src/Repositories/ProductRepository.php b/packages/Sarga/Shop/src/Repositories/ProductRepository.php index 9c7e56c..eb580b0 100644 --- a/packages/Sarga/Shop/src/Repositories/ProductRepository.php +++ b/packages/Sarga/Shop/src/Repositories/ProductRepository.php @@ -9,7 +9,7 @@ use Illuminate\Support\Arr; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Event; use Illuminate\Support\Facades\Log; -use Sarga\Brand\Repositories\BrandRepository; +// use Sarga\Brand\Repositories\BrandRepository; use Webkul\Attribute\Repositories\AttributeGroupRepository; use Webkul\Attribute\Repositories\AttributeOptionRepository; use Webkul\Attribute\Repositories\AttributeRepository; @@ -28,7 +28,7 @@ class ProductRepository extends WProductRepository protected $attributeValueRepository; protected $imageRepository; protected $vendorProductRepository; - protected $brandRepository; + // protected $brandRepository; protected $fillableTypes = ['sku', 'name', 'url_key', 'short_description', 'description', 'price', 'weight', 'status']; @@ -40,7 +40,7 @@ class ProductRepository extends WProductRepository ProductImageRepository $productImageRepository, VendorProductRepository $vendorProductRepository, VendorRepository $vendorRepository, - BrandRepository $brandRepository, + // BrandRepository $brandRepository, AttributeOptionRepository $optionRepository) { $this->attributeGroupRepo = $attributeGroupRepo; @@ -49,7 +49,7 @@ class ProductRepository extends WProductRepository $this->productFlatRepository = $productFlatRepository; $this->imageRepository = $productImageRepository; $this->vendorProductRepository = $vendorProductRepository; - $this->brandRepository = $brandRepository; + // $this->brandRepository = $brandRepository; $this->vendorRepository = $vendorRepository; parent::__construct($attributeRepository, $app); @@ -100,9 +100,9 @@ class ProductRepository extends WProductRepository // ->addSelect('marketplace_sellers.logo'); } - if(isset($params['brand'])){ - $qb->whereIn('product_flat.brand_id', explode(',',$params['brand'])); - } + // if(isset($params['brand'])){ + // $qb->whereIn('product_flat.brand_id', explode(',',$params['brand'])); + // } if (! core()->getConfigData('catalog.products.homepage.out_of_stock_items')) { $qb = $this->checkOutOfStockItem($qb); @@ -279,7 +279,7 @@ class ProductRepository extends WProductRepository $product['type'] = (!empty($data['color_variants']) || !empty($data['size_variants'])) ? 'configurable':'simple'; - $attributes = Arr::only($data,['brand','cinsiyet']); + // $attributes = Arr::only($data,['brand','cinsiyet']); try { DB::beginTransaction(); @@ -294,9 +294,9 @@ class ProductRepository extends WProductRepository } else $product['attribute_family_id'] = $product['type'] == 'configurable' ? 2 : 1; - if(!empty($data['brand']) && $brand = $this->brandRepository->findOneByField('name' , $data['brand'])){ - $product['brand_id'] = $brand->id; - } + // if(!empty($data['brand']) && $brand = $this->brandRepository->findOneByField('name' , $data['brand'])){ + // $product['brand_id'] = $brand->id; + // } //create product $parentProduct = $this->getModel()->create($product); $this->assignAttributes($parentProduct, [