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 | |
if ('Mage_Sales_Model_Order_Item' == get_class($item)) { | |
$product = null; | |
$options = $item->getProductOptions(); | |
if (!empty($options['info_buyRequest']) && !empty($options['info_buyRequest']['product'])) { | |
$product = Mage::getModel('catalog/product')->load($options['info_buyRequest']['product']); | |
if (!empty($product)) { |
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
import xml.dom.minidom, urllib | |
def getText(nodelist): | |
rc = [] | |
for node in nodelist: | |
if node.nodeType == node.TEXT_NODE: | |
rc.append(node.data) | |
return ''.join(rc) | |
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
#!/bin/sh | |
MYSQLCMD=$(which mysql) | |
# Read Magento primary connection info | |
DBHOST=$(/PATH/TO/php -r "echo simplexml_load_file('/PATH/TO/app/etc/local.xml', NULL, LIBXML_NOCDATA)->global->resources->default_setup->connection->host;") | |
DBUSER=$(/PATH/TO/php -r "echo simplexml_load_file('/PATH/TO/app/etc/local.xml', NULL, LIBXML_NOCDATA)->global->resources->default_setup->connection->username;") | |
DBPASS=$(/PATH/TO/php -r "echo simplexml_load_file('/PATH/TO/app/etc/local.xml', NULL, LIBXML_NOCDATA)->global->resources->default_setup->connection->password;") | |
DBNAME=$(/PATH/TO/php -r "echo simplexml_load_file('/PATH/TO/app/etc/local.xml', NULL, LIBXML_NOCDATA)->global->resources->default_setup->connection->dbname;") |
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
/** | |
* Addresses this bug: http://www.magentocommerce.com/bug-tracking/issue/?issue=13203 | |
* | |
* See app/code/core/Mage/Adminhtml/controllers/Catalog/CategoryController.php | |
* Mage_Adminhtml_Catalog_CategoryController::saveAction(), starting around | |
* line 307 | |
*/ | |
if (isset($data['category_products']) && | |
!$category->getProductsReadonly()) { | |
$products = array(); |
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 | |
class BigThings | |
{ | |
/** | |
* Process all the things | |
*/ | |
public function changeEverything() | |
{ | |
$this->log("Starting...hold on to your hats."); |
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 | |
class BigThings | |
{ | |
/** | |
* Process all the things | |
*/ | |
public function changeEverything() | |
{ | |
$this->log("Starting...hold on to your hats."); |
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 headless Selenium testing system is an ideal addition to any development workflow. Selenium reduces testing time, and integrates into CI tools such as Jenkins. The benefits are great, but only *if* you can get your tests to run. | |
One of the most time consuming problems that can arise from a headless system is a failed test. How can you debug, when you can't see the browser? Ideally, you will test your scripts locally before running them on the headless system, but anyone who has even dabbled in the world of automation knows that a single procedure can yield very different results on different systems and in different environments. You can deal with the differences, but first you have to see them. | |
After much searching, I could not find a straight answer as to how to export this display to my Windows machine from our Linux server. It is really quite simple, and can be done in a few steps. | |
In order to display a headless Selenium test on a Windows machine from a Linux server, you must first be able to have |
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 | |
// app/code/core/Mage/Adminhtml/Model/Config/Data.php: 135: | |
/** | |
* Get field backend model | |
*/ | |
$backendClass = $fieldConfig->backend_model; | |
if (!$backendClass) { | |
$backendClass = 'core/config_data'; |
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 | |
/** | |
* Load a world and its child channels. Typically detects world from | |
* current category, but can also be passed a category slug. | |
* | |
* This is a heavy method. It loads related media, content, etc., | |
* sufficient to populate all content on the page. | |
* | |
* @param string $for_slug Identifier for the world to load. |
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 | |
/** | |
* Populate an existing object with the results of a WP JSON API response, | |
* which includes a custom_fields object. These can be the same object. In | |
* this case, leave the second parameter blank or as null. | |
* | |
* @param stdClass $object | |
* @param stdClass $response_object JSON response. | |
* @param bool $load_relations Optional; pass false to disable | |
* loading all related content. |
OlderNewer