Scaling Magento presentation with 60 slides and notes, which was then reviewed by Alan Storm.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class Ip_Category_Model_Image | |
| { | |
| public function getResizedImage($image, $width, $height = null, $quality = 100) | |
| { | |
| if(!$image){return false;} | |
| $imageUrl = Mage::getBaseDir('media').DS."catalog".DS."category".DS.$image; | |
| if(!is_file($imageUrl)){return false;} | |
| $imageResized = Mage::getBaseDir('media').DS."catalog".DS."category".DS."cache".DS."cat_resized".DS.$image; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $i++; | |
| $_class = ''; | |
| if ($i % 4 == 0) $_class .= ' last-4-col'; | |
| if (($i - 1) % 4 == 0) $_class .= ' first-4-col'; | |
| if ($i % 3 == 0) $_class .= ' last-3-col'; | |
| if (($i - 1) % 3 == 0) $_class .= ' first-3-col'; | |
| $_class .= ($i % 2 == 0) ? ' even' : ' odd'; | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0"?> | |
| <config> | |
| <modules> | |
| <YOUR_MODULE> | |
| <version>0.1.0</version> | |
| </YOUR_MODULE> | |
| </modules> | |
| <frontend> | |
| <layout> | |
| <updates> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0"?> | |
| <layout version="0.1.0"> | |
| <default> | |
| <reference="head"> | |
| <action method="addCss"><stylesheet>css/YOURSTYLESHEET.css</stylesheet></action> | |
| </reference> | |
| </default> | |
| </layout> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script> | |
| my_variable = '<?php echo $this->getBigTemplate();?>'; | |
| </script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class Ip_Test_Model_Observer | |
| { | |
| public function implementOrderStatus(Varien_Event_Observer $observer) | |
| { | |
| $order = $observer->getEvent()->getOrder(); | |
| $orderItems = $order->getAllVisibleItems(); | |
| foreach ($orderItems as $item) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Get collection size | |
| * | |
| * @return int | |
| */ | |
| public function getSize() | |
| { | |
| if (is_null($this->_totalRecords)) { | |
| $sql = $this->getSelectCountSql(); | |
| $this->_totalRecords = $this->getConnection()->fetchOne($sql, $this->_bindParams); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $collection = Mage::getModel('catalog/product')->getCollection(); | |
| $collection->joinField('category_id', 'catalog/category_product', 'category_id', 'product_id = entity_id', null, 'left'); | |
| $collection->addAttributeToFilter('category_id', array('null' => true)); | |
| $collection->addAttributeToFilter('status', 1); | |
| $collection->addAttributeToSelect('*'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public function sendVendorNotification($po, $comment='') | |
| { | |
| $vendor = $po->getVendor(); | |
| $method = $vendor->getNewOrderNotifications(); | |
| if (!$method || $method=='0') { | |
| return $this; | |
| } |