Jump to content

Bypassing Catalog Mode, etc. using GET parameter


Recommended Posts

Hi all,

 

Since there's no way AFAIK of bypassing catalog mode by default, I'm trying to figure out how to efficiently bypass catalog mode using a GET parameter.

 

I've tried adding the following to my header.tpl (knowing it probably won't work):

 

{if $smarty.get.foo == 'bar'}
 {$PS_CATALOG_MODE=0}
{/if}

 

...I'm probably way off, but I hope it gives you an idea of what I'm trying to do.

 

I need to solve this, since we have a shop in production (not ready to sell from and thus in catalog mode) and we need to show the checkout process to an external entity for approval.

 

Do anybody have a solution for this challenge - any ideas, input or help will be greatly appreciated.

 

Thanks in advance and have a great weekend!

Link to comment
Share on other sites

Update:

 

I figured out how to do this. There might be other ways to do it, but I did it by overriding FrontController:

 

/override/classes/controller/FrontController.php

 

<?php

class FrontController extends FrontControllerCore
{
function init()
{
parent::init();
if (isset($_GET['foo']))
{
$this->context->cookie->foo = true;
}
if (isset($_GET['foo']) && $_GET['foo']=="0")
{
unset($this->context->cookie->foo);
}
if (isset($this->context->cookie->foo))
{
$this->context->smarty->assign('PS_CATALOG_MODE', false);
}
}
}

Link to comment
Share on other sites

×
×
  • Create New...