SET FOREIGN_KEY_CHECKS=0; TRUNCATE `sales_flat_creditmemo`; TRUNCATE `sales_flat_creditmemo_comment`; TRUNCATE `sales_flat_creditmemo_grid`; TRUNCATE `sales_flat_creditmemo_item`; TRUNCATE `sales_flat_invoice`; TRUNCATE `sales_flat_invoice_comment`; TRUNCATE `sales_flat_invoice_grid`; TRUNCATE `sales_flat_invoice_item`; TRUNCATE `sales_flat_order`; TRUNCATE `sales_flat_order_address`; TRUNCATE `sales_flat_order_grid`; TRUNCATE `sales_flat_order_item`; TRUNCATE `sales_flat_order_payment`; TRUNCATE `sales_flat_order_status_history`; TRUNCATE `sales_flat_quote`; TRUNCATE `sales_flat_quote_address`; TRUNCATE `sales_flat_quote_address_item`; TRUNCATE `sales_flat_quote_item`; TRUNCATE `sales_flat_quote_item_option`;...
Month: April 2015
Get rewritten product url in a different store
It was pointed out to me in one of the preceding articles that getting a product’s URL in a different store can get pretty complicated if the URL you want to get is rewritten. I decided to come up with...
4 Simple but Effective Ways to Improve Magento’s Performance
4 Simple but Effective Ways to Improve Magento’s Performance When Magento is not set up correctly, it will run slowly since it is a ‘heavy’ eCommerce CMS system. Even the most experienced web developers might miss the not so obvious...
add ssh in mac
user@localhost: ssh-keygen -t dsa Generating public/private dsa key pair. Enter file in which to save the key (/Users/user/.ssh/id_dsa): id_dsa Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in id_dsa. Your public key has...
magento check stock qty est out stock
$_product=Mage::getModel('catalog/product')->getCollection()->addAttributeToFilter('type_id', array('eq' => 'simple')); foreach($_product as $p) { $stock=Mage::getModel('cataloginventory/stock_item')->loadByProduct($p); if($stock->getIsInStock()==="0"&&$stock->getQty()>=1) { echo $p->getSku(); echo '<br/>'; echo $p->getId(); echo '<br/>'; } }
Zend Framework Database Query
Zend Framework Database Query Database Manipulation Create a controller Call / Create(Write) Database configuration setting Request data object creation Assign message (Success / Failure / Already exists) Create a view page to see the message or to redirect to the...
use zend adapter conncet exterme DB
$db = new Zend_Db_Adapter_Pdo_Mysql(array( 'host' => '174.142.90.89', 'username' => 'devleero_app', 'password' => 'app123', 'dbname' => 'devleero_vu_centerdata', 'profiler' => true, )); $profiler = $db->getProfiler(); $sql='select * from product_simple'; $data=$result = $db->fetchAssoc($sql);; $i=0; foreach($data as $d) { var_dump($d); $i++; } echo 'total:'.$i;
generate Data Center product to cvs (module verification)
SELECT di.sku,di.nom,di.couleur ,s.name as size, m.name_model as modele_nom , m.id_model as modele_id , ma.name as marque_nom ,ma.id_mark as marque_id,di.qty,di.sexe,prix,di.etiquette,di.combined_width, di.warranty,di.prescription FROM product_simple as di inner join models as m on m.name_model=di.modele_nom inner join mark as ma on ma.name = di.marque_nom...