• studio1337

    (@studio1337)


    Hi folks,

    We are looking at doing something with WordPress that we’ve never tried before, and I’m having trouble wrapping my head around the best way to pull this off. The solution is probably simple, but I’m just not seeing it.

    One of our clients has a site that uses WordPress for static pages and blogging, and PDGSoft for eCommerce. PDG runs through CGI (I believe in PERL, but I’m not 100% sure). The client has decided she wants the shopping cart to be the home page of the site, but of course WordPress should continue to power the rest of the site.

    With WordPress installed at the account root, how do we “give control” of the home page of the site to PDGSoft (or any other app, for that matter), without doing something kludgy like setting up a home page 301 redirect pushing all home page traffic to the “cart home,” which may have significant SEO implications? PDG would be pushed to the home page through an htaccess URL rewrite, I *think*.

Viewing 3 replies - 1 through 3 (of 3 total)
  • catacaustic

    (@catacaustic)

    If it was me, I’d start off by giving the WordPress home page a custom template by creating a front-page.php file in your theme (preferrably your child theme so it doesn’t get over-written by any future updates), and use that to drag in the HTML from the other system. That will let you keep the home page set up as they want it, but it will also let you keep both systems happy at the same time.

    As a very quick and dirty example, something like this will work fine:

    <?php
        require ('https://www.mysite/pdg/carthome.php');

    The only condition is that you need to make sure that allow_url-fopen is set to open, which most servers have.

    Thread Starter studio1337

    (@studio1337)

    Thanks for the response and for pointing me in a direction that may end up working once I get my head wrapped around what’s happening. The server does support allow_url-fopen (and if it didn’t, we would change that – we run the server).

    I ran a test on this, creating a page template and including the cart home page using ‘require’. I’m not primarily a programmer (I can hold my own, but I’m more of a front-end dev personally), so my understanding of what’s happening may not be accurate, but I’m thinking there’s a processing order that’s not happening favorably.

    https://tinyurl.com/n6znk5d – we are redesigning everything from the top down (it’s been 4 years), but as you can see on this page, nothing is pulling in.

    If you look at the source, I created a comment containing the PHP that I’m using. As you can see, we’re attempting to pull in a page that is being generated within cgi-bin, and we would need that process to spit out straight-up HTML prior to including the contents using PHP, if this sequence of events (and use of multiple technologies) can be made to work.

    Or I may by looking at this completely wrong, or I might have misunderstood how you intended this to work. Anything come to mind when looking at this POC?

    catacaustic

    (@catacaustic)

    The first thing to do is to ensure that the URL that you’re trying to use is going to be the correct one. To do that I’d add i nthis little bit of debugging…

    <?php
    $url = $_SERVER['DOCUMENT_ROOT'].'/cgi-bin/commerce.cgi?display=home';
    echo "<p>URL: '".$url."'</p>";
    require ($url);

    That will print the URL that you’re trying to pull in. My first thought on seeing what you’re doing here is that you’re URL won’t have the https:// at the front, so the system will see that as a file on the file system, and not an online URL. Becuase of that it won’t find that page (as the file won’t exist on your file system) so it will be blank.

    One big trick when you’re in development is to change this in your wp-config.php file:

    define('WP_DEBUG', true);

    That will display the errors that are being generated on the site, and you’ll most likely see what’s going on here. Just remember to change it back before taking the site into production!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Allowing another app to populate the home page’ is closed to new replies.