This is an explanation of how getting it set up pretty quick without customization. If you want you can customize everything, take a look at the code and documentation for details.
class AppController extends Controller {
public $components = array(
'Cart.CartManager'
);
public $helpers = array(
'Cart.Cart'
);
public function beforeRender() {
parent::beforeRender();
}
}class Product extends AppModel {
public $actsAs = array(
'Cart.Buyable'
);
}Buy things via GET
echo $this->Cart->link(__('buy me'), array(
'item' => $item['Item']['id']
));Buy things via POST
echo $this->Form->create('Product', array(
'url' => array(
'action' => 'buy'
)
));
echo $this->Form->input('quantity', array(
'label' => false,
'default' => 1
));
echo $this->Form->submit(__('buy me'), array(
'div' => false
));
echo $this->Form->hidden('foreign_key', array(
'value' => $product['Product']['id']
));
echo $this->Form->hidden('model', array(
'value' => 'Product'
));