Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8952319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:50:55+00:00 2026-06-15T13:50:55+00:00

I am due to put a Magento site live and the client has sprung

  • 0

I am due to put a Magento site live and the client has sprung a last minute request. They are a UK based manufacturer and they don’t want to compete with their worldwid supply chain, so they want;

  1. All users with IPs originating in North America get redirected to a totally different website (non-Magento, nothing to do with me) ideally with a redirect message.
  2. All user with IPs originating anywhere other than North America, The UK and Ireland get to see the site but with the pricing and cart disabled so they don’t see prices and can’t make a purchase
  3. UK and Ireland operate as normal.

I’m trying to work out the best way to approach this. I am aware of three options;

  • .HTACCESS

I’ve worked on a store before where the developer has set a huge list of IPs in the .htaccess (mainly blocking China and Russia as a security thing). I could do something similar, redirecting users with USA IPs and then maybe setting an environmental variable like so;

How to set a custom global from .htaccess

Which could be accessed in the templates to not display the add to cart and price markup.

Pros: Relatively Easy

Cons: Horrible. The list of IPs would be hardcoded, and the conditional code to display/not display the prices etc would be template based rather than done via a module. Plus the ‘You are being transferred to our USA store’ request couldn’t be handled this way.

  • Store switching using commercial module

Another option could be to customise/configure the following commercial module to handle the request;

http://www.mageworx.com/store-and-currency-auto-switcher-magento-extension.html

I’m thinking this would involve setting up new websites rather than new stores (as the current installation already has 1 Website and 2 Stores each with one Store View.). The new websites would have their own theme with no cart/price info displayed.

Pros: IPs not hardcoded, uses the MaxMind GeoIP database. Module based.
Cons: Again the code whether to display the Prices is template based. Also this would add a lot of administration overhead for the user – extra websites, extra store views to complicate things. And not using 99% of the features of this module.

  • A Custom Module to handle it

I know this is the ideal solution but I am much happier in app/design than I am in app/code. I know how to build a module and have built very small modules before but…. Based on Alan Storm’s blog post here;

http://magento-quickies.tumblr.com/post/32402056167/magento-startup-events

I am imagining I would use the controller_front_init_before event and create an observer which extends a class or classes relating to the isSaleable() method which is used in the product view templates anyway. Possibly??

Pros: This is the right way to do it. No admin overhead. Easy to disable/enable.

Any suggestions, pointers or links on this would be a big help. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T13:50:56+00:00Added an answer on June 15, 2026 at 1:50 pm

    Here is a kick-off for what you called an “ideal solution”.

    Get my free GeoIP extension from MagnetoConnect or GitHub. Then in any template use:

    $geoIP = Mage::getSingleton('geoip/country');
    ...
    <?php if($geoIP->isCountryAllowed()) ?>
        the block of code you want to display only for selected countries
    <?php endif ?>
    

    More info in my article here.

    If you have any question please feel free to ask.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Due to a weird request, I can't put null in a database if there
Due to HTML5 browser formats tricks I have to put fallback audio formats also
We have an issue where hibernate-validator-3.0.0.ga.jar gets put into a warfile and due to
I have a dataGridView that has a column called Date Due which is of
My test system (due to lack of resources) has a dual mongodb replicaset. There
I'm trying to put tag into JQuery-ui dialog widget. Due to some other problems
It seems that due to the SQL Azure Firewall Rules my Windows Azure has
Due to a problem posting, my last question (duplicate of this) was closed. Background
I've just put some photos up online and I noticed that they photos appear
I'm trying to remove a due date from a task using the following request:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.