1

I'm using Magento 1.9

I want to activate a new store view for our office IP only because we want to make changes in that views.

How to make that?

1
  • Are you using nginx? because I've got an idea for you if so Mar 13, 2018 at 15:16

1 Answer 1

2

You need to find the template of store view switcher (Language switcher template), you can use the Template Path Hints feature of Magento:

Backend > System > Configuration > Advanced section > Developer tab > Debug fieldset > Template Path Hints field

Please pay attention you need switch the Current Configuration Scope to needed website or store view, also I advise to specify your IP address here:

Backend > System > Configuration > Advanced section > Developer tab > Developer Client Restrictions fieldset > Allowed IPs (comma separated) field

to prevent of displaying of path hints to other users.

The Magento uses the following template by default:

Magento_root/app/design/frontend/base/default/template/page/switch/languages.phtml

The next step - you need to modify this template.
Please add the following line of code:

<?php if (3 == $_lang->getId() && '192.168.169.62' != $_SERVER['REMOTE_ADDR']) continue; ?>

where:
3 - ID of your store view;
192.168.169.62 - allowed IP address.

after the following line of code:

<?php foreach ($this->getStores() as $_lang): ?>

You can get a ID of store view here:

Backend > System > Manage Stores

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.