This shopping cart is using CodeIgniter framework that allows you to add/update/delete a product from the cart. I am using the database in my previous post as a fixed on the existing shopping cart I found in the internet.
This code is totally different from the code at “How to Build Shopping Cart w/ Checkout in PHP”. It has a cleaner code, secured and most importantly easy to understand.
Shopping cart with checkout using CodeIgniter is part of the tutorial that I am currently working. I will explain this one by one on how I created this code in the next few days.
It's so easy to create a cart using CodeIgniter. Here's an example code:
public function add() { $this->load->model('Cart_model'); 'id' => $this->input->post('id'), 'name' => $this->input->post('name'), 'price' => $this->input->post('price'), 'qty' => 1 ); $this->cart->insert($insert_room); redirect('cart'); }
0 comments:
Post a Comment
Don't Forget to comment