Getting all products of orders of last 24 hours in magento 1 in a large databaseadd to cart button to refresh the pageBroken links on Grouped products (=links generated to hidden product not redirected to group)Magento: How to get customer last order by joining customers and orders?How to create REST API in magento after configuring REST Roles , OAuth Consumers and Users with that role?Get all orders/purchased products for each customerMagento 2 EE - fetch products with sales data on split database solutionMagento 2 get Order Collection and product skuRandom missing product name in random ordersI am not getting all the products after executing my querymodule related to Reviews.co.uk getting time out exception

Should I give professor gift at the beginning of my PhD?

When conversion from Integer to Single may lose precision

Why is one of Madera Municipal's runways labelled with only "R" on both sides?

How can I tell the difference between unmarked sugar and stevia?

Pre-1972 sci-fi short story or novel: alien(?) tunnel where people try new moves and get destroyed if they're not the correct ones

Does an ice chest packed full of frozen food need ice?

Arriving at the same result with the opposite hypotheses

Can the poison from Kingsmen be concocted?

Taxi Services at Didcot

Frame failure sudden death?

SQL counting distinct over partition

Mobile App Appraisal

Should I avoid hard-packed crusher dust trails with my hybrid?

eval() in Lightning Web Components

Inward extrusion is not working

Is the term 'open source' a trademark?

C++ Arduino IDE receiving garbled `char` from function

Confusion around using "des" in sentences

How come the nude protesters were not arrested?

Why doesn't Adrian Toomes give up Spider-Man's identity?

Thread Pool C++ Implementation

Cycle through MeshStyle directives in ListLinePlot

How can electric fields be used to detect cracks in metals?

English word for "product of tinkering"



Getting all products of orders of last 24 hours in magento 1 in a large database


add to cart button to refresh the pageBroken links on Grouped products (=links generated to hidden product not redirected to group)Magento: How to get customer last order by joining customers and orders?How to create REST API in magento after configuring REST Roles , OAuth Consumers and Users with that role?Get all orders/purchased products for each customerMagento 2 EE - fetch products with sales data on split database solutionMagento 2 get Order Collection and product skuRandom missing product name in random ordersI am not getting all the products after executing my querymodule related to Reviews.co.uk getting time out exception






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I have a third party module in my magento 1 which is fetching products like this:
$products = Mage::getModel('catalog/product')->getCollection();
So I want to replace it with selective products which are ordered in last 24 hrs. but the issue is I know how to fetch last 24 hrs orders but they are not returning items(products) ID or SKU. PLease let me know how to get products of last 24 hrs orders.



Here is my query of getting the orders:



$products = Mage::getResourceModel('sales/order_item_collection')
->addAttributeToSelect('*')
->addFieldToFilter('created_at', array(
'from' => strtotime('-1 day', time()),
'to' => time(),
'datetime' => true
))
->load();


So how can I edit this to fetch product items instead of order items?



Thank you










share|improve this question






























    0















    I have a third party module in my magento 1 which is fetching products like this:
    $products = Mage::getModel('catalog/product')->getCollection();
    So I want to replace it with selective products which are ordered in last 24 hrs. but the issue is I know how to fetch last 24 hrs orders but they are not returning items(products) ID or SKU. PLease let me know how to get products of last 24 hrs orders.



    Here is my query of getting the orders:



    $products = Mage::getResourceModel('sales/order_item_collection')
    ->addAttributeToSelect('*')
    ->addFieldToFilter('created_at', array(
    'from' => strtotime('-1 day', time()),
    'to' => time(),
    'datetime' => true
    ))
    ->load();


    So how can I edit this to fetch product items instead of order items?



    Thank you










    share|improve this question


























      0












      0








      0








      I have a third party module in my magento 1 which is fetching products like this:
      $products = Mage::getModel('catalog/product')->getCollection();
      So I want to replace it with selective products which are ordered in last 24 hrs. but the issue is I know how to fetch last 24 hrs orders but they are not returning items(products) ID or SKU. PLease let me know how to get products of last 24 hrs orders.



      Here is my query of getting the orders:



      $products = Mage::getResourceModel('sales/order_item_collection')
      ->addAttributeToSelect('*')
      ->addFieldToFilter('created_at', array(
      'from' => strtotime('-1 day', time()),
      'to' => time(),
      'datetime' => true
      ))
      ->load();


      So how can I edit this to fetch product items instead of order items?



      Thank you










      share|improve this question
















      I have a third party module in my magento 1 which is fetching products like this:
      $products = Mage::getModel('catalog/product')->getCollection();
      So I want to replace it with selective products which are ordered in last 24 hrs. but the issue is I know how to fetch last 24 hrs orders but they are not returning items(products) ID or SKU. PLease let me know how to get products of last 24 hrs orders.



      Here is my query of getting the orders:



      $products = Mage::getResourceModel('sales/order_item_collection')
      ->addAttributeToSelect('*')
      ->addFieldToFilter('created_at', array(
      'from' => strtotime('-1 day', time()),
      'to' => time(),
      'datetime' => true
      ))
      ->load();


      So how can I edit this to fetch product items instead of order items?



      Thank you







      magento-1.9 orders catalog products order-items






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited May 31 at 5:41









      Muhammad Wasif

      15311




      15311










      asked May 30 at 7:23









      Stack userStack user

      1628




      1628




















          1 Answer
          1






          active

          oldest

          votes


















          0














          If I want to add 'updated_at' too in the filter with the same condition like 'created_at' then what should I do in below query:



           $products = Mage::getResourceModel('catalog/product_collection')
          ->addAttributeToSelect('*')
          ->addFieldToFilter('created_at', array(
          'from' => strtotime('-2 days', time()),
          'to' => time(),
          'datetime' => true
          ))->load();


          Please help






          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%2f276686%2fgetting-all-products-of-orders-of-last-24-hours-in-magento-1-in-a-large-database%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            If I want to add 'updated_at' too in the filter with the same condition like 'created_at' then what should I do in below query:



             $products = Mage::getResourceModel('catalog/product_collection')
            ->addAttributeToSelect('*')
            ->addFieldToFilter('created_at', array(
            'from' => strtotime('-2 days', time()),
            'to' => time(),
            'datetime' => true
            ))->load();


            Please help






            share|improve this answer



























              0














              If I want to add 'updated_at' too in the filter with the same condition like 'created_at' then what should I do in below query:



               $products = Mage::getResourceModel('catalog/product_collection')
              ->addAttributeToSelect('*')
              ->addFieldToFilter('created_at', array(
              'from' => strtotime('-2 days', time()),
              'to' => time(),
              'datetime' => true
              ))->load();


              Please help






              share|improve this answer

























                0












                0








                0







                If I want to add 'updated_at' too in the filter with the same condition like 'created_at' then what should I do in below query:



                 $products = Mage::getResourceModel('catalog/product_collection')
                ->addAttributeToSelect('*')
                ->addFieldToFilter('created_at', array(
                'from' => strtotime('-2 days', time()),
                'to' => time(),
                'datetime' => true
                ))->load();


                Please help






                share|improve this answer













                If I want to add 'updated_at' too in the filter with the same condition like 'created_at' then what should I do in below query:



                 $products = Mage::getResourceModel('catalog/product_collection')
                ->addAttributeToSelect('*')
                ->addFieldToFilter('created_at', array(
                'from' => strtotime('-2 days', time()),
                'to' => time(),
                'datetime' => true
                ))->load();


                Please help







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered May 31 at 8:10









                Stack userStack user

                1628




                1628



























                    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%2f276686%2fgetting-all-products-of-orders-of-last-24-hours-in-magento-1-in-a-large-database%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

                    Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

                    Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

                    Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?