Where to upload PHP files that query data tables in Magento The Next CEO of Stack OverflowOverriding send email functions with custom functionsCopying data between tables via PHP not working?How Secure Are User Made PHP Files?Order emails not sending to Sales Representative (store email address)Sending order email when pragmatically updating an orderExport Orders from Magento MySQL DB without MagentoBlock/limit/filter addresses or email address?Past deleted order details being used by new ordersWhere magento store data from account info on order pageMagento1 order extra steps for custom items

Is there a difference between "Fahrstuhl" and "Aufzug"

Would this house-rule that treats advantage as a +1 to the roll instead (and disadvantage as -1) and allows them to stack be balanced?

Why has the US not been more assertive in confronting Russia in recent years?

How to start emacs in "nothing" mode (`fundamental-mode`)

How to prevent changing the value of variable?

If a black hole is created from light, can this black hole then move at speed of light?

WOW air has ceased operation, can I get my tickets refunded?

Indicator light circuit

Why do we use the plural of movies in this phrase "We went to the movies last night."?

Make solar eclipses exceedingly rare, but still have new moons

Is micro rebar a better way to reinforce concrete than rebar?

Why do remote companies require working in the US?

Are there any limitations on attacking while grappling?

Why didn't Khan get resurrected in the Genesis Explosion?

Can you replace a racial trait cantrip when leveling up?

"In the right combination" vs "with the right combination"?

What flight has the highest ratio of time difference to flight time?

Which kind of appliances can one connect to electric sockets located in an airplane's toilet?

Can I equip Skullclamp on a creature I am sacrificing?

Why is the US ranked as #45 in Press Freedom ratings, despite its extremely permissive free speech laws?

What is the result of assigning to std::vector<T>::begin()?

Inappropriate reference requests from Journal reviewers

Return the Closest Prime Number

How did the Bene Gesserit know how to make a Kwisatz Haderach?



Where to upload PHP files that query data tables in Magento



The Next CEO of Stack OverflowOverriding send email functions with custom functionsCopying data between tables via PHP not working?How Secure Are User Made PHP Files?Order emails not sending to Sales Representative (store email address)Sending order email when pragmatically updating an orderExport Orders from Magento MySQL DB without MagentoBlock/limit/filter addresses or email address?Past deleted order details being used by new ordersWhere magento store data from account info on order pageMagento1 order extra steps for custom items










0















I have noticed that when exporting customer information through the admin panel it doesn't include all of the customers from the orders area.



I have been searching around for PHP code that does the job, although what I first need to understand is where I need to upload these PHP files for them to run successfully.



I am basically just wanting to export customer names and email addresses from the orders table so that I can import them into our email marketing application (and yes we do have permission to contact these people).



Do I need to upload PHP files to a specific folder in Magento for the queries to be able to access the data tables?










share|improve this question




























    0















    I have noticed that when exporting customer information through the admin panel it doesn't include all of the customers from the orders area.



    I have been searching around for PHP code that does the job, although what I first need to understand is where I need to upload these PHP files for them to run successfully.



    I am basically just wanting to export customer names and email addresses from the orders table so that I can import them into our email marketing application (and yes we do have permission to contact these people).



    Do I need to upload PHP files to a specific folder in Magento for the queries to be able to access the data tables?










    share|improve this question


























      0












      0








      0








      I have noticed that when exporting customer information through the admin panel it doesn't include all of the customers from the orders area.



      I have been searching around for PHP code that does the job, although what I first need to understand is where I need to upload these PHP files for them to run successfully.



      I am basically just wanting to export customer names and email addresses from the orders table so that I can import them into our email marketing application (and yes we do have permission to contact these people).



      Do I need to upload PHP files to a specific folder in Magento for the queries to be able to access the data tables?










      share|improve this question
















      I have noticed that when exporting customer information through the admin panel it doesn't include all of the customers from the orders area.



      I have been searching around for PHP code that does the job, although what I first need to understand is where I need to upload these PHP files for them to run successfully.



      I am basically just wanting to export customer names and email addresses from the orders table so that I can import them into our email marketing application (and yes we do have permission to contact these people).



      Do I need to upload PHP files to a specific folder in Magento for the queries to be able to access the data tables?







      magento-enterprise orders php






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 45 mins ago









      Teja Bhagavan Kollepara

      3,01241949




      3,01241949










      asked Feb 3 '14 at 14:09









      user3182742user3182742

      85




      85




















          2 Answers
          2






          active

          oldest

          votes


















          0














          Just as long as you can get to the mage application from your script, it doesn't really matter where. Within reason of course - some will tell you to create a module in the local codebase, I prefer a "scripts" folder in the Magento root for simple data access. It depends on how involved you want to get with it.



          In your script in the scripts folder, you can access the Application like so:



          require_once("../app/Mage.php");


          Once you have that, you can access the orders collection:



          $orders = Mage::getModel('sales/order')->getCollection();


          The reason you are not seeing all customers from orders is likely guest orders - if a customer checks out as a guest they are not saved in the list of customers.






          share|improve this answer























          • Lovely stuff - thanks Ben. I have now been able to push on with this and create a PHP script that accesses the Sales Order table and writes all of the customer names and email addresses to a downloadable CSV file. I've password protected this PHP file for obvious reasons. If anyone would like me to post the code then please let me know and I'll be happy to do so. Thanks again - the Stack Exchange community are the best!

            – user3182742
            Feb 4 '14 at 18:25


















          1














          As Ben already said, you can put them anywhere.
          We usually create a folder called tools for this kind of scripts which is located in the document root.






          share|improve this answer























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "479"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f14330%2fwhere-to-upload-php-files-that-query-data-tables-in-magento%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Just as long as you can get to the mage application from your script, it doesn't really matter where. Within reason of course - some will tell you to create a module in the local codebase, I prefer a "scripts" folder in the Magento root for simple data access. It depends on how involved you want to get with it.



            In your script in the scripts folder, you can access the Application like so:



            require_once("../app/Mage.php");


            Once you have that, you can access the orders collection:



            $orders = Mage::getModel('sales/order')->getCollection();


            The reason you are not seeing all customers from orders is likely guest orders - if a customer checks out as a guest they are not saved in the list of customers.






            share|improve this answer























            • Lovely stuff - thanks Ben. I have now been able to push on with this and create a PHP script that accesses the Sales Order table and writes all of the customer names and email addresses to a downloadable CSV file. I've password protected this PHP file for obvious reasons. If anyone would like me to post the code then please let me know and I'll be happy to do so. Thanks again - the Stack Exchange community are the best!

              – user3182742
              Feb 4 '14 at 18:25















            0














            Just as long as you can get to the mage application from your script, it doesn't really matter where. Within reason of course - some will tell you to create a module in the local codebase, I prefer a "scripts" folder in the Magento root for simple data access. It depends on how involved you want to get with it.



            In your script in the scripts folder, you can access the Application like so:



            require_once("../app/Mage.php");


            Once you have that, you can access the orders collection:



            $orders = Mage::getModel('sales/order')->getCollection();


            The reason you are not seeing all customers from orders is likely guest orders - if a customer checks out as a guest they are not saved in the list of customers.






            share|improve this answer























            • Lovely stuff - thanks Ben. I have now been able to push on with this and create a PHP script that accesses the Sales Order table and writes all of the customer names and email addresses to a downloadable CSV file. I've password protected this PHP file for obvious reasons. If anyone would like me to post the code then please let me know and I'll be happy to do so. Thanks again - the Stack Exchange community are the best!

              – user3182742
              Feb 4 '14 at 18:25













            0












            0








            0







            Just as long as you can get to the mage application from your script, it doesn't really matter where. Within reason of course - some will tell you to create a module in the local codebase, I prefer a "scripts" folder in the Magento root for simple data access. It depends on how involved you want to get with it.



            In your script in the scripts folder, you can access the Application like so:



            require_once("../app/Mage.php");


            Once you have that, you can access the orders collection:



            $orders = Mage::getModel('sales/order')->getCollection();


            The reason you are not seeing all customers from orders is likely guest orders - if a customer checks out as a guest they are not saved in the list of customers.






            share|improve this answer













            Just as long as you can get to the mage application from your script, it doesn't really matter where. Within reason of course - some will tell you to create a module in the local codebase, I prefer a "scripts" folder in the Magento root for simple data access. It depends on how involved you want to get with it.



            In your script in the scripts folder, you can access the Application like so:



            require_once("../app/Mage.php");


            Once you have that, you can access the orders collection:



            $orders = Mage::getModel('sales/order')->getCollection();


            The reason you are not seeing all customers from orders is likely guest orders - if a customer checks out as a guest they are not saved in the list of customers.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Feb 3 '14 at 15:12









            Ben TrubyBen Truby

            506311




            506311












            • Lovely stuff - thanks Ben. I have now been able to push on with this and create a PHP script that accesses the Sales Order table and writes all of the customer names and email addresses to a downloadable CSV file. I've password protected this PHP file for obvious reasons. If anyone would like me to post the code then please let me know and I'll be happy to do so. Thanks again - the Stack Exchange community are the best!

              – user3182742
              Feb 4 '14 at 18:25

















            • Lovely stuff - thanks Ben. I have now been able to push on with this and create a PHP script that accesses the Sales Order table and writes all of the customer names and email addresses to a downloadable CSV file. I've password protected this PHP file for obvious reasons. If anyone would like me to post the code then please let me know and I'll be happy to do so. Thanks again - the Stack Exchange community are the best!

              – user3182742
              Feb 4 '14 at 18:25
















            Lovely stuff - thanks Ben. I have now been able to push on with this and create a PHP script that accesses the Sales Order table and writes all of the customer names and email addresses to a downloadable CSV file. I've password protected this PHP file for obvious reasons. If anyone would like me to post the code then please let me know and I'll be happy to do so. Thanks again - the Stack Exchange community are the best!

            – user3182742
            Feb 4 '14 at 18:25





            Lovely stuff - thanks Ben. I have now been able to push on with this and create a PHP script that accesses the Sales Order table and writes all of the customer names and email addresses to a downloadable CSV file. I've password protected this PHP file for obvious reasons. If anyone would like me to post the code then please let me know and I'll be happy to do so. Thanks again - the Stack Exchange community are the best!

            – user3182742
            Feb 4 '14 at 18:25













            1














            As Ben already said, you can put them anywhere.
            We usually create a folder called tools for this kind of scripts which is located in the document root.






            share|improve this answer



























              1














              As Ben already said, you can put them anywhere.
              We usually create a folder called tools for this kind of scripts which is located in the document root.






              share|improve this answer

























                1












                1








                1







                As Ben already said, you can put them anywhere.
                We usually create a folder called tools for this kind of scripts which is located in the document root.






                share|improve this answer













                As Ben already said, you can put them anywhere.
                We usually create a folder called tools for this kind of scripts which is located in the document root.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Feb 3 '14 at 20:01









                Anna VölklAnna Völkl

                15.6k347134




                15.6k347134



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Magento Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f14330%2fwhere-to-upload-php-files-that-query-data-tables-in-magento%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Can not update quote_id field of “quote_item” table magento 2Magento 2.1 - We can't remove the item. (Shopping Cart doesnt allow us to remove items before becomes empty)Add value for custom quote item attribute using REST apiREST API endpoint v1/carts/cartId/items always returns error messageCorrect way to save entries to databaseHow to remove all associated quote objects of a customer completelyMagento 2 - Save value from custom input field to quote_itemGet quote_item data using quote id and product id filter in Magento 2How to set additional data to quote_item table from controller in Magento 2?What is the purpose of additional_data column in quote_item table in magento2Set Custom Price to Quote item magento2 from controller

                    Magento 2 disable Secret Key on URL's from terminal The Next CEO of Stack OverflowMagento 2 Shortcut/GUI tool to perform commandline tasks for windowsIn menu add configuration linkMagento oAuth : Generating access token and access secretMagento 2 security key issue in Third-Party API redirect URIPublic actions in admin controllersHow to Disable Cache in Custom WidgetURL Key not changing in Magento 2Product URL Key gets deleted when importing custom options - Magento 2Problem with reindex terminalMagento 2 - bin/magento Commands not working in Cpanel Terminal

                    Aasi (pallopeli) Navigointivalikko