Post by GeckoStar » Fri Nov 09, 2018 3:02 am

Hi,

Is there any way to put a single multi-store into maintenance only? The only way seems to be putting the main (default) store into maintenance but that will disrupt all the other multi-stores.

Suppose i edit the url for the multi-store to a 404 page, would that be possible as a workaround or would people still be able to access the store using a direct link to a product/category?

Any help would be appreciated, thanks.

Newbie

Posts

Joined
Mon Oct 22, 2018 12:32 pm

Post by straightlight » Fri Nov 09, 2018 7:03 am

The direct link would still be available unless the startup maintenance is being edited as the following:

In your catalog/controller/startup/maintenance.php file,

find:

Code: Select all

$this->user = new Cart\User($this->registry);
add below:

Code: Select all

$stores = array(0, 1, 2, 3); // Where 0, 1, 2, 3 would be each store IDs for example.
Where 0, 1, 2, 3 would be each store IDs for example.

Then, replace:

Code: Select all

if ((substr($route, 0, 17) != 'extension/payment' && substr($route, 0, 3) != 'api') && !in_array($route, $ignore) && !$this->user->isLogged()) {
with:

Code: Select all

if ((substr($route, 0, 17) != 'extension/payment' && substr($route, 0, 3) != 'api') && !in_array($route, $ignore) && in_array((int)$this->config->get('config_store_id'), (array)$stores) && !$this->user->isLogged()) {

The most generated errors being found on Opencart forum originates from contributed programming. The increased counters are caused by posted redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 21 guests