<?php
require('app/Mage.php');
Mage::app();
$product = Mage::getModel('catalog/product')->getCollection()->getFirstItem();
var_dump($product->getData('media_gallery'));
This file contains 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
🏃. 5x Magento Certified, 2x Magento Master. ✝ Follower. Co-host @magetalk,@commercefuture. Organizer @magentosofla. Evangelist @somethingdigitl |
This file contains 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 | |
/** | |
* A simple fix for a shell execution on preg_match('/[0-9]\.[0-9]+\.[0-9]+/', shell_exec('mysql -V'), $version); | |
* The only edit that was done is that shell_exec('mysql -V') was changed to mysql_get_server_info() because not all | |
* systems have shell access. XAMPP, WAMP, or any Windows system might not have this type of access. mysql_get_server_info() | |
* is easier to use because it pulls the MySQL version from phpinfo() and is compatible with all Operating Systems. | |
* @link http://www.magentocommerce.com/knowledge-base/entry/how-do-i-know-if-my-server-is-compatible-with-magento | |
* @author Magento Inc. | |
*/ |
This file contains 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
OpenSTV version 1.7 (http://www.OpenSTV.org/) | |
Suggested donation for using OpenSTV for an election is $50. Please go to | |
http://www.OpenSTV.org/donate to donate via PayPal, Google Checkout, or | |
Amazon Payments. | |
Certified election reports are also available. Please go to | |
http://www.openstv.org/certified-reports for more information. | |
Loading ballots from file magento-stackexchange-com-2015-election-results.blt. |
This file contains 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
<a href="#" class="button">Obnoxious button</a> |
This file contains 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 | |
$__ = array(Mage::helper('yourcompany/helper'), '__'); | |
//usage | |
echo $__('Translate me'); |
This file contains 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
class Sample_Model_Observer | |
{ | |
protected $colToAdd = 'colname'; | |
/** | |
* @param Varien_Event_Observer $observer | |
*/ | |
public function urapidflow_profile_action( $observer ) | |
{ | |
$action = $observer->getData( 'action' ); | |
$profile = $observer->getData( 'profile' ); |
Follow each step manually and any bugs during (resource) model instantiation will become obvious.
Since many people find model and resource model instantiation to be one of the more challenging things in Magento 1, these are all the steps Magento does to resolve the factory name to the real PHP class name.
To debug, simply follow each step manually until you find a non-match. This works really well in my experience.
Less guessing, more and faster results.
In the examples I use a factory name of "example/thing".
This file contains 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
var cornify_count = 0; | |
var cornify_add = function() { | |
cornify_count += 1; | |
var cornify_url = 'http://www.cornify.com/'; | |
var div = document.createElement('div'); | |
div.style.position = 'fixed'; | |
var numType = 'px'; | |
var heightRandom = Math.random()*.75; | |
var windowHeight = 768; |
NewerOlder