Add custom attribute to Sales Order in Magento

1> Step 1 require_once('app/Mage.php'); Mage::app()->setCurrentStore(Mage::getModel('core/store')->load(Mage_Core_Model_App::ADMIN_STORE_ID)); $installer = new Mage_Sales_Model_Mysql4_Setup; $attribute = array( 'type' => 'text', 'backend_type' => 'text', 'frontend_input' => 'text', 'is_user_defined' => true, 'label' => 'Amazone Order Id', 'visible'…

Save XML from url to file

set_time_limit(0); $fp = fopen ('./products.xml', 'w+'); $ch = curl_init('http://siteurl......');// or any url you can pass which gives you the xml curl_setopt($ch, CURLOPT_TIMEOUT, 50); curl_setopt($ch, CURLOPT_FILE, $fp); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_exec($ch); curl_close($ch); fclose($fp);

Magento. Removing white image background

<div> <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->constrainOnly(TRUE)->keepAspectRatio(TRUE)->keepFrame(FALSE)->resize(210); ?>" width="164" height="210" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>