Advertisement
Guest User

Untitled

a guest
Jan 15th, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.63 KB | None | 0 0
  1.                 $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'];}
  2.                 $this->data['products'][] = array(
  3.                     'product_id' => $result['product_id'],
  4.                     'thumb'      => $image,
  5.                     'name'       => $result['name'],
  6.                     'category_name'=> $category_name,
  7.                     'category_id'=> $category_category_id,
  8.                     'category_sort'=> $category_sort_order,
  9.                     'price'      => $price,
  10.                     'price_byr'  => $price_byr,
  11.                     'special'    => $special,
  12.                     'special_byr'=> $special_byr,
  13.                     'rating'     => $rating,
  14.                     'reviews'    => sprintf($this->language->get('text_reviews'), (int)$result['reviews']),
  15.                     'href'       => $this->url->link('product/product', 'product_id=' . $result['product_id']),
  16.             );
  17.                 if (!in_array($category_name, $category_names)){
  18.                         $category_names[] = $category_name;}
  19.                         $this->data['products_cat'] = $category_names;
  20.             }
  21.             foreach ($this->data['products_cat'] as $name) {
  22.                 $products = array();
  23.                 foreach ($this->data['products'] as $result) {
  24.                     if($name == $result['category_name']){
  25.                         $products[] = array('product_id' => $result['product_id'],
  26.                             'thumb'=> $result['thumb'],
  27.                             'name'=> $result['name'],
  28.                             'price'=> $result['price'],
  29.                             'special'=> $result['special'],
  30.                             'rating'=> $result['rating'],
  31.                             'reviews'=> $result['reviews'],
  32.                             'href'=> $result['href']);}}
  33.                     $this->data['categories'][] = array('name'=> $name,'products'=> $products, 'category_category_id'=>$category_category_id);}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement