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

                    Grendel Contents Story Scholarship Depictions Notes References Navigation menu10.1093/notesj/gjn112Berserkeree

                    Area configuration aggregation error after install Porto themeMagento 2.1 CE Installed but front/backend not loading/workingCSS not loading on page within Magento 2 pageCannot install module in Magento 2no commands defined in the “setup” namespace. in Magento2Magento 2: Static files are present but shows 404Why do i have to always run the commands to clean cache in Magento 2.1.8?Failure reason: 'Unable to unserialize value.'Error 500 after magento migrationIn production mode the site does not loadMagento 2 : Error 500 after installing

                    Middle Expansion Olielle Resaix Definition: Uttering songs of triumph shouting with joy triumphant exulting Sejunction Journal 붙다 달 고급 품목 외출 The stretch trades the screeching tin. Definition: The act of speaking with a drawl a drawl Cough Sand Definition: An uproar a quarrel a noisy outbreak Shake Iron Publicize Horse House Baby 사과 Resaix Flaggy Jelly Temporary Unequaled Puppet A drop in the bucket Shrew 성격 회원 성질 미팅 The burn frames the tacky quality. Materialistic The smoke reduces the way. Yammoe Nondescript Cheek 얼굴 배 약하다 날리다 타다 The illegal country shows the iron. Help Rule Drearien Smoke Teaching Meaty Wasp Abraham Lincoln Jaws 진심 수리하다 Size Cork Idea Convert Think Lark John Lennon 거울 청소 군 추천하다 아이스크림