[CODE] Get Product That Have “Expired” Special Price on Magento

Posted on Leave a commentPosted in Programming, Magento, PHP

$catalogCol= Mage::getModel(‘catalog/product’)->getCollection(); //get data for special price that expired $catalogCol->addAttributeToSelect(‘name’) ->addAttributeToSelect(‘price’) ->addAttributeToFilter(‘status’, array(‘eq’ => Mage_Catalog_Model_Product_Status::STATUS_ENABLED)) ->addAttributeToFilter(‘special_price’, array(‘gt’ => 0)) ->addAttributeToFilter(‘special_to_date’, array(‘date’ => true, ‘from’ => $todayDate, ‘to’ => $todayDate)); We can select what attribute that we need to be shown and then if we want to filter based on another attribute, we can use “addAttributeToFilter”.

[CODE] Get New Product on Magento

Posted on Leave a commentPosted in Programming, PHP

Below is code for get collection data that contain product with new SKU based on created data.. $catalogCol= Mage::getModel(‘catalog/product’)->getCollection(); //get data that new SKU product $catalogCol->addAttributeToSelect(‘name’) ->addAttributeToSelect(‘price’) ->addAttributeToFilter(‘status’, array(‘eq’ => Mage_Catalog_Model_Product_Status::STATUS_ENABLED)) ->addAttributeToFilter(‘created_at’, array(‘date’ => true, ‘from’ => $todayDate,’to’ => $date)); We can select what attribute that we need to be shown and then if we […]

Redhat server cannot send email

Posted on Leave a commentPosted in Programming, Linux

I want to share how to solve the problem if our server (I use Redhat base) suddenly cannot sending the email. You can check the email log with code tail -f /var/log/maillog In My case, I have problem : [code] postfix/smtp[22031]: F2F76411B9: to=<———–>, relay=aspmx.l.google.com[00.00.00.00]:25, delay=1129, delays=1127/0.07/0.9/1.3, dsn=2.0.0, status=sent (250 2.0.0 OK 1392263109 ix4si518951pbb.29 – gsmtp) […]

Always Failed When Microsoft Dynamic AX Client

Posted on Leave a commentPosted in ERP, Microsoft

On this article, I want to share my experience with Microsoft Dynamic AX 2009 Client on Windows 7 I had an error below: [code] === Setup logging started: 1/2/2014 10:54:19 AM === Running file: "C:UsersADMINI~1AppDataLocalTempAxSetupAxSetup.exe" RelatedFilesDir="C:Usersdewi.yartiDesktop1-DynamicsAX2009" AxSetup version number: 5.0.593.0 Microsoft Windows NT 6.1.7601 Service Pack 1 (32 bit) Computer Name ——Administrator Interactive: True RelatedFilesDir=C:Usersdewi.yartiDesktop1-DynamicsAX2009 […]

Install Siege Load Test

Posted on Leave a commentPosted in Programming, PHP

We can use Siege app to do load test especially to test Magento application. The steps to install Siege on Linux environment are: – Download the application from http://www.joedog.org and download the latest version of Siege. – Copy the tar file to your server, and then extract using command : tar -xvf siege.tar.gz – Go […]