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

                    Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

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

                    Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form