Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2020
    Location
    Scotland
    Posts
    29
    Plugin Contributions
    0

    Default How to hide sandbox from google/customers?

    Zen 1.5.5f

    Hi,
    Can someone tell me the correct way to hide my sandbox webite website from customers? The site has been running for years without issue, but lately customers are being able to place orders on my Sandbox site! The order numbers are old (from 18 months ago) and these orders are for products I no longer sell, not to mention how unprofessional it looks to customers explaining why we dont have a proper order for them.

    I have put sandbox in maintenance mode, but they can still order if they had items in their basket before maintenance. I am condsidering just deleting the sandbox folder from the server to avoid any issues, but would prefer to keep it if I can stop google etc indexing it.

    Any help or ideas appreciated

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,474
    Plugin Contributions
    88

    Default Re: How to hide sandbox from google/customers?

    In these circumstances, I normally create a file named /includes/extra_datafiles/test_site.php containing:
    Code:
    <?php
    // -----
    // This script checks to see if the current location is running the 'live' site.  If not,
    // override various API keys to use the test versions.
    //
    if (HTTP_SERVER . DIR_WS_CATALOG != 'https://example.com') {
        $allowed_ips = array(
    //-a list of IP addresses that are allowed to access the test site
        );
        if (!isset($_SERVER['REMOTE_ADDR']) || !in_array($_SERVER['REMOTE_ADDR'], $allowed_ips)) {
            die();
        }
    }
    Note that the code above presumes that the site's running SSL-all-the-time. Just replace example.com with your site's URL and add the list of IP addresses that can access the test site.

    You can also use this file to override database-configuration settings via PHP define statements.

  3. #3
    Join Date
    Apr 2020
    Location
    Scotland
    Posts
    29
    Plugin Contributions
    0

    Default Re: How to hide sandbox from google/customers?

    Thank you so much for your quick reply.

    I will create that file with my ssl site now :)

  4. #4
    Join Date
    Apr 2020
    Location
    Scotland
    Posts
    29
    Plugin Contributions
    0

    Default Re: How to hide sandbox from google/customers?

    Hello,

    Thank you for replying so quickly.

    I tried that but it makes my entire live website blank too. I tried the url with and without the www part.
    My website is fully https so no idea what i've done wrong
    PHP Code:
    <?php
    // -----
    // This script checks to see if the current location is running the 'live' site.  If not,
    // override various API keys to use the test versions.
    //
    if (HTTP_SERVER DIR_WS_CATALOG != 'https://www.beeunique.co.uk') {
        
    $allowed_ips = array(
    //-a list of IP addresses that are allowed to access the test site
        
    );
        if (!isset(
    $_SERVER['REMOTE_ADDR']) || !in_array($_SERVER['REMOTE_ADDR'], $allowed_ips)) {
            die();
        }
    }

  5. #5
    Join Date
    Apr 2020
    Location
    Scotland
    Posts
    29
    Plugin Contributions
    0

    Default Re: How to hide sandbox from google/customers?

    Sorry, it wont let me edit that last post (hate double posting).

    It's not working - it makes my entire main website go blank too - tried it with and without the www part after https://

    I think I will just download a copy then delete the sandbox folder for now to make sure no-one can order through it. Am assuming deleting the sandbox folder should not cause any issue to my main website (can you tell I dont know squat about php etc).

  6. #6
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,474
    Plugin Contributions
    88

    Default Re: How to hide sandbox from google/customers?

    Quote Originally Posted by BeePud View Post
    Sorry, it wont let me edit that last post (hate double posting).

    It's not working - it makes my entire main website go blank too - tried it with and without the www part after https://

    I think I will just download a copy then delete the sandbox folder for now to make sure no-one can order through it. Am assuming deleting the sandbox folder should not cause any issue to my main website (can you tell I dont know squat about php etc).
    Did you add any IP addresses to that $ip_array? Is the main site's HTTP_SERVER + DIR_WS_CATALOG settings (in /includes/configure.php) set to include that www. prefix or not?

 

 

Similar Threads

  1. Hide Weight from Customers?
    By Harvezter in forum Managing Customers and Orders
    Replies: 10
    Last Post: 9 Feb 2010, 03:04 PM
  2. Google Checkout Sandbox won't let me purchase from myself!
    By butchx5 in forum Addon Payment Modules
    Replies: 2
    Last Post: 26 Feb 2009, 02:36 PM
  3. Hide Table Shipping Module from Certain Customers
    By bearaman in forum General Questions
    Replies: 1
    Last Post: 29 Jun 2007, 05:51 AM
  4. How do I hide the units in stock from the customers?
    By getaway in forum Setting Up Categories, Products, Attributes
    Replies: 6
    Last Post: 14 Oct 2006, 08:28 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR