Example #1
0
 public function show($product_id, $product_name = '')
 {
     if (!$product_id) {
         echo 'product_show return false';
     }
     array_push($this->data['js_functions'], array('name' => 'home_prodcut_show_init', 'data' => FALSE));
     #!
     $product_category_selected = new Product_category();
     $product_type_selected = new Product_type();
     $product_selected = new Product();
     $nutrition_categories = new Nutrition_category();
     #!
     $product_selected->get_full_info($product_id);
     $product_selected->nutrition->get_full_info();
     #$product_selected->nutrition->convert_to_mera(2);
     $product_type_selected->get_full_info($product_selected->product_type_id);
     $product_type_selected->product->get_full_info();
     $product_category_selected->get_full_info($product_type_selected->product_category_id);
     $nutrition_categories->get_full_info();
     #!
     $meras_available = array('100 gramms');
     foreach ($product_selected->mera as $mera) {
         $meras_available[$mera->join_seq] = $mera->join_name . ' ( ' . $mera->join_value . ' )';
     }
     #!
     $this->data['meras_available'] = $meras_available;
     $this->data['dm_product_category_selected'] = $product_category_selected;
     $this->data['dm_product_type_selected'] = $product_type_selected;
     $this->data['dm_product_selected'] = $product_selected;
     $this->data['dm_nutrition_categories'] = $nutrition_categories;
     #nutritions by selected product
     $this->data['dm_nutritions'] = $product_selected->nutrition;
     $this->data['dm_products'] = $product_type_selected->product;
     array_push($this->data['crumbs'], array('name' => 'home', 'link' => $this->linker->home_page_link()));
     array_push($this->data['crumbs'], array('name' => $product_selected->join_name, 'link' => false));
     #!
     $this->template->load('/templates/main_template', '/products/product_show', $this->data);
 }
Example #2
0
 public function search_result()
 {
     $query_string = 'apple';
     $product_type_names = new Languages_Product_type();
     $product_type = new Product_type();
     $product_type_names->like('name', $query_string, 'after')->get(1);
     #PRODUCT TYPE
     foreach ($product_type_names as $type) {
         $return_arr['product_types'][] = $query_string . '<strong>' . str_ireplace($query_string, '', $type->name) . '</strong>';
     }
     #PRODUCT_by_first_type
     if (isset($product_type_names->all[0])) {
         $product_type->get_full_info($product_type_names->all[0]->id);
         $product_type->product->get_short_info();
         $data['dm_products'] = $product_type->product;
         $return_arr['product_items'] = $this->load->view('search/products/items', $data, true);
     } else {
         $return_arr['product_items'] = array();
     }
     $return_arr['status'] = true;
     print_flex($product_type_names->all[0]);
     $this->output->enable_profiler(true);
     return;
 }
Example #3
0
 function get_products_list()
 {
     $type_id = (int) $this->input->post('type_id');
     if (!$type_id and !is_numeric($type_id)) {
         echo 'return !';
     }
     $product_type = new Product_type();
     $products = new Product();
     $product_type->get_full_info($type_id);
     $product_type->product->get_full_info();
     $this->data['dm_products'] = $product_type->product;
     $this->load->view('admin/products/sub/show_products_list', $this->data);
 }
Example #4
0
 function run_axaj_proba()
 {
     $product_type_names = new Languages_Product_type();
     $product_type = new Product_type();
     $product_type_names->like('name', 'ch', 'after')->get(5);
     #PRODUCT_by_first_type
     if (isset($product_type_names->all[0])) {
         $product_type->get_full_info($product_type_names->all[0]->id);
         $product_type->product->get_short_info();
         $data['dm_products'] = $product_type->product;
         $return_arr['product_items'] = $this->load->view('search/products/items', $data, true);
     } else {
         $return_arr['product_items'] = array();
     }
     foreach ($product_type->product as $product) {
         print_flex($product->nutrition->data);
         echo dm_get_value_by_field('Protein', $product->nutrition, 'join_name');
         return;
     }
     #print_flex(dm_get_value_by_field('Protein',$product_type->product->nutrition,'join_name'));
 }