Hi! It is possible to give us the source, with the template and php integrated + mysql ?
@eduonixsupport18897 жыл бұрын
You can download the resource file from below link. s3.amazonaws.com/edu-resources/Projectsin-PHPand-MySQL/resource-PayPalCheckout.zip
@eugenegrassie64777 жыл бұрын
Thank you for an awesome tutorial. I completed the entire project, and I actually learned something. However... the categories are now dynamic, and when you click on it, it takes you to the page of that category. That's good. But could you please assist us to create/finalise the page the category url takes us to, and then only show the items in that category? Thank you once again for doing a wonderfull job. Regards
@eduonixsupport18897 жыл бұрын
You mean when we click on category link you want to display products under that category.
@eugenegrassie64777 жыл бұрын
Eduonix Support yes sir. When you click on the category, to only show that category. Thank you again. Regards
@eduonixsupport18897 жыл бұрын
Add below code in 1)Product_model.php file //get products in the category public function get_category_products($category_id){ $this->db->select('*'); $this->db->from('products'); $this->db->where('category_id',$category_id); $query = $this->db->get(); return $query->result(); } 2)add this into products.php file of controller public function category($id){ //get product details //2 nd change $data['products'] =$this->product_model->get_category_products($id); //Load View $data['main_content'] = 'category'; $this->load->view('layouts/main', $data); } 3)add this into category.php file of view
@eugenegrassie64777 жыл бұрын
That worked perfectly. Thank you very very much. Just 1 problem I found. In the products.php under controller, the P that i put in () needs to be a Capital P for the code to work. Your code: $data['products'] =$this->product_model->get_category_products($id); but for the code to work without errors, it must be: $data['products'] =$this->Product_model->get_category_products($id);