Skip to content

Commit

Permalink
add size image and selling point
Browse files Browse the repository at this point in the history
  • Loading branch information
xxl4 committed Feb 27, 2025
1 parent a9e5369 commit 0c63b2b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ public function quickCreate(Request $request){
}
$input['attribute_family_id'] = $attributeFamily->id;

var_dump($input);exit;

// create super attributes and check if the attribute is valid
$attributeRepository = app('Webkul\Attribute\Repositories\AttributeRepository');
$attributeOptionDeleted = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public function slug($slug)
{

$product = $this->getRepositoryInstance()->findBySlug($slug);

if (!$product) {
return response()->json(['message' => 'Product not found', 'code' => 202, 'data' => []]);
}
Expand Down
11 changes: 11 additions & 0 deletions src/Http/Resources/Api/V1/Shop/Catalog/ProductResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Webkul\Checkout\Facades\Cart;
use Webkul\Product\Facades\ProductImage;
use Webkul\Product\Helpers\BundleOption;
use Illuminate\Support\Facades\Redis;

class ProductResource extends JsonResource
{
Expand Down Expand Up @@ -47,6 +48,14 @@ public function toArray($request)
$packages_package = \Nicelizhi\OneBuy\Helpers\Utils::makeProducts($product, [2,1,3,4]);
}

$redis = Redis::connection('default');

$sell_points_key = "sell_points_".$product->url_key;
$sell_points = $redis->hgetall($sell_points_key);




/* generating resource */
return [
/* product's information */
Expand All @@ -65,6 +74,7 @@ public function toArray($request)
'base_image' => ProductImage::getProductBaseImage($product),
'created_at' => $product->created_at,
'updated_at' => $product->updated_at,
'product_size_img' => $product->product_size_img,

/* product's reviews */
'reviews' => [
Expand All @@ -85,6 +95,7 @@ public function toArray($request)
$product->type !== 'grouped',
$product->getTypeInstance()->showQuantityBox()
),
'sell_point' => $sell_points,

/* product's extra information */
$this->merge($this->allProductExtraInfo()),
Expand Down

0 comments on commit 0c63b2b

Please sign in to comment.