Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $category_data = $this->model_catalog_product->getProductCategory($result['product_id']);foreach($category_data as $id){$category_name = $id['name'];$category_category_id = $id['category_id'];$category_sort_order = $id['sort_order'];}
- $this->data['products'][] = array(
- 'product_id' => $result['product_id'],
- 'thumb' => $image,
- 'name' => $result['name'],
- 'category_name'=> $category_name,
- 'category_id'=> $category_category_id,
- 'category_sort'=> $category_sort_order,
- 'price' => $price,
- 'price_byr' => $price_byr,
- 'special' => $special,
- 'special_byr'=> $special_byr,
- 'rating' => $rating,
- 'reviews' => sprintf($this->language->get('text_reviews'), (int)$result['reviews']),
- 'href' => $this->url->link('product/product', 'product_id=' . $result['product_id']),
- );
- if (!in_array($category_name, $category_names)){
- $category_names[] = $category_name;}
- $this->data['products_cat'] = $category_names;
- }
- foreach ($this->data['products_cat'] as $name) {
- $products = array();
- foreach ($this->data['products'] as $result) {
- if($name == $result['category_name']){
- $products[] = array('product_id' => $result['product_id'],
- 'thumb'=> $result['thumb'],
- 'name'=> $result['name'],
- 'price'=> $result['price'],
- 'special'=> $result['special'],
- 'rating'=> $result['rating'],
- 'reviews'=> $result['reviews'],
- 'href'=> $result['href']);}}
- $this->data['categories'][] = array('name'=> $name,'products'=> $products, 'category_category_id'=>$category_category_id);}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement