add estimated shipping functionnality in cart
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user