Why not to use directly Context::getContext()->cart->id ?