[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 […]

Error CI 1.6 on XAMPP 1.7

Posted on Leave a commentPosted in Programming, PHP

We can solve it by: System/codeigniter/CodeIgniter.php Change  : $objects[$class] =& new $name(); To : $objects[$class] =new $name(); System/database/DB.php Change : $DB =& new $driver($params); To : $DB =new $driver($params); System/libraries/Loader.php Change : $CI->dbutil =& new $class(); To : $CI->dbutil = new $class(); System/libraries/URI.php Change : if ( ! preg_match(“|^[“.preg_quote($this->config->item(‘permitted_uri_chars’)).”]+$|i”, $str)) To : if ( ! […]

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 […]

Cannot load from mysql.proc

Posted on Leave a commentPosted in SQL Server, PHP

Today, I’ve problem with my database. When I try to export/backup a database, the following error is shown: [code] Cannot load from mysql.proc. The table is probably corrupted [/code] And that is happened because some error in mysql engine. I try to solve it with upgrade mysql engine. The following steps are: 1. Using command […]

Apache service can’t be started

Posted on Leave a commentPosted in Programming, PHP

You’ve installed apache server on your laptop or computer, and then it cannot be started when you click “Start” button? Okay, I want  to share tips to solve it. In case, my laptop uses Windows 7. Check the port that have “LISTENING” status. You can use command prompt and type : [code] C:Users>netstat -ao [/code] […]