Skip to content

Commit

Permalink
fecshop category filter
Browse files Browse the repository at this point in the history
  • Loading branch information
fancyecommerce committed Mar 6, 2019
1 parent 1beeb3a commit e356996
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions services/category/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,24 @@ protected function actionConvertToCategoryInfo($collection)
$image = $defaultImg;
}
list($price, $special_price) = $this->getPrices($one['price'], $one['special_price'], $one['special_from'], $one['special_to']);
$product_id = '';

if (isset($one['product_id']) && $one['product_id']) {
$product_id = (string)$one['product_id'];
} else {
$product_id = (string)$one['_id'];
}
$arr[] = [
'name' => $name,
'sku' => $one['sku'],
'reviw_rate_star_average' => isset($one['reviw_rate_star_average']) ? $one['reviw_rate_star_average'] : 0,
'review_count' => isset($one['review_count']) ? $one['review_count'] : 0,
'_id' => (string)$one['_id'],
'_id' => $product_id,
'image' => $image,
'price' => $price,
'special_price' => $special_price,
'url' => Yii::$service->url->getUrl($url_key),
'product_id' => (string)$one['_id'],
'product_id' => $product_id,
];
}
}
Expand Down

0 comments on commit e356996

Please sign in to comment.