magento get orders

//to get orders based on date range   $period_date_from = $this->getRequest()->getParam('report_from'); $from_date = strtotime($period_date_from); // begin date $period_date_to = $this->getRequest()->getParam('report_to'); $to_date = strtotime($period_date_to); // begin date $myOrder=Mage::getModel('sales/order'); $orders=Mage::getModel('sales/mysql4_order_collection'); $to_date =…

magento filter products

//filter for products whose orig_price is greater than (gt) 100 $collection->addFieldToFilter(array( array('attribute'=>'orig_price','gt'=>'100'), )); //AND filter for products whose orig_price is greater than (lt) 130 $collection->addFieldToFilter(array( array('attribute'=>'orig_price','lt'=>'130'), )); //get products of…

Tips to Creating Magento Products by Scripts

<?php require_once 'app/Mage.php'; $app = Mage::app(); ?> <?php $product = Mage::getModel('catalog/product'); $product->setSku("ABC123hhsgfsgg"); $product->setName("Type 7 Widget"); $product->setDescription("This widget will give you years of trouble-free widgeting."); $product->setShortDescription("High-end widget."); $product->setPrice(70.50); $product->setTypeId('simple'); $product->setAttributeSetId(4); //…