add estimated shipping functionnality in cart

This commit is contained in:
Julien Chanséaume
2014-04-25 09:43:22 +02:00
parent f556a7d149
commit ac51ab21e4
7 changed files with 341 additions and 6 deletions

View File

@@ -12,16 +12,24 @@
namespace Thelia\Tools;
use Symfony\Component\HttpFoundation\Cookie;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Thelia\Log\Tlog;
class Redirect
{
public static function exec($url, $status = 302)
public static function exec($url, $status = 302, $cookies = array())
{
if (false == Tlog::getInstance()->showRedirect($url)) {
$response = new RedirectResponse($url, $status);
foreach ($cookies as $cookie)
{
if (!$cookie instanceof Cookie)
{
throw new \InvalidArgumentException(sprintf('Third parameter is not a valid Cookie object.'));
}
$response->headers->setCookie($cookie);
}
$response->send();
}
}