I want to show image in cart system in codeigniter. But I failed to do that. I am new in codeigniter. So I need some help from you.
here is my controller:::
class Cart extends CI_Controller {
public function add_to_cart($product_id) { // adds a product to cart
$this->load->model('cart_model');
$result = $this->cart_model->selectProductByProductId($product_id);
$insert = array(
'id' => $product_id,
'qty' => 1,
'price' => $result->product_price,
'name' => $result->product_name,
'image' => $result->product_image
);
//$this->load->library('Cart');
$this->cart->insert($insert);
redirect("cart/show_cart");
}
View:::
<?php echo $items['image'] ?>
This is not working in cart view page .. Maybe I need some change with cart library but I do not know where I edit or update. Please help me out .