Is it possible to add price values to product options in the Codeigniter Cart Class. For example: T-shirt price is $10.00, but the XXL size is an extra $2.00.
$data = array(
'id' => 'abc',
'qty' => 1,
'price' => 10.00,
'name' => 'T-Shirt',
'options' => array('Size' => 'XXL') // Where would you add $2.00 for XXL?
);
$this->cart->insert($data);
That’s one of the reasons why we built our own cart and order management system apart from CI’s original one.
The better way imho is to extend or rebuild CI’s cart Class in order to inject product and options straight from db results. This way you can always track down how the price was calculated : from ericofsac’s answer, why it is priced at 12 not 10 and how much the option was charged at sale’s time.
You can also ease implementation of recording interfaces from your cart data to your order, but that’s another point.