Skip to content

Instantly share code, notes, and snippets.

@NitishDiwakar
Created April 6, 2018 10:28
Show Gist options
  • Save NitishDiwakar/b7316d306b9c9293badb77638217e4bb to your computer and use it in GitHub Desktop.
Save NitishDiwakar/b7316d306b9c9293badb77638217e4bb to your computer and use it in GitHub Desktop.
public function index()
{
$this->loadModel('Products');
$this->viewBuilder()->setLayout('new');
$ip = $this->request->clientIp();
$carts = $this->Carts->find('all')
->where(['Carts.ip' => $ip])
->contain(['Products']);
$this->set(compact('carts'));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment