Search code examples
phpwordpressimportopencartfeed

How can i post information from a external generated php file on to wordpress?


Hy guys, I'm not so familiar with php-wordpress so any help is welcome. I managed to extract information from a sql OpenCart platform but now I need to import that information into WordPress. If anyone has any idea I would appreciate. The outpoted information looks like this:

This is the cathegory, subcategory, Model, product id, product name: Femei > Fuste||EPS094|51|Fusta din brocart|

This is the description: Fusta "baby-doll" din brocart, usor evazata, de culoare roz, din bumbac 100%. Are aplicata in partea de jos o dantela fina roz.

Lungime: 48 cm.

this is the generated link, price, image link and availability: |http://allboutique.ro/fusta-din-brocart.html?utm_source=testal3&utm_medium=cpc&utm_campaign=direct_link|http://allboutique.ro/image/data/Femei/Untitled-3.jpg|79.99|RON||In stock|

This is just for one product, and i need to make a someking of php that can import this products to a category wordpress.

Thank you very much for assisting me! Cheers, Alex

If need i can post a link to the external file so that u can see the generated info


Solution

  • You can make an webservice of your php file and then you can ask the informations with jQuery and JavaScript on the client.

    Some pseudo code:

    Server:

    <?php
        echo 'Your informations, JSON format would be awesome!';
    ?>
    

    Client:

    ...
    <p id="myobject">Loading...</p>
    <script>
        $.ajax({
          url: "the url to your php file",
          context: document.body
        }).done(function(r) {
          $('#myobject').text(r);
        });
    </script>
    ...
    

    Result should be something like this:

    <p id="myobject">Your informations, JSON format would be awesome!</p>
    

    As next step you can implement JSON to transfer your data simpler.