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
# Author: Pieter Noordhuis | |
# Description: Simple demo to showcase Redis PubSub with EventMachine | |
# | |
# Update 7 Oct 2010: | |
# - This example does *not* appear to work with Chrome >=6.0. Apparently, | |
# the WebSocket protocol implementation in the cramp gem does not work | |
# well with Chrome's (newer) WebSocket implementation. | |
# | |
# Requirements: | |
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby |
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
UPDATE `catalog_eav_attribute` | |
SET `used_for_sort_by` = 1 | |
WHERE attribute_id = ( | |
SELECT attribute_id FROM `eav_attribute` WHERE `entity_type_id` = (SELECT `entity_type_id` FROM `eav_entity_type` WHERE `entity_model` = "catalog/product") AND `attribute_code` = "created_at"); | |
UPDATE `eav_attribute` | |
SET frontend_label = "Newest" | |
WHERE `entity_type_id` = (SELECT `entity_type_id` FROM `eav_entity_type` WHERE `entity_model` = "catalog/product") and `attribute_code` = "created_at"; |
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
Index: app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Collection.php | |
=================================================================== | |
--- app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Collection.php (revision 2102) | |
+++ app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Collection.php (working copy) | |
@@ -553,7 +553,11 @@ | |
->from($this->getTable('core/url_rewrite'), array('product_id', 'request_path')) | |
->where('store_id=?', Mage::app()->getStore()->getId()) | |
->where('is_system=?', 1) | |
- ->where('category_id=? OR category_id is NULL', $this->_urlRewriteCategory) | |
+// excluding this clause to facilitate one URL per product, and one that includes the category |
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
UPDATE `catalog_eav_attribute` | |
SET `used_for_sort_by` = 1 | |
WHERE `attribute_id` = (SELECT `attribute_id` FROM `eav_attribute` WHERE `entity_type_id` = (SELECT `entity_type_id` FROM `eav_entity_type` WHERE `entity_model` = "catalog/product") AND `attribute_code` = "created_at"); | |
UPDATE `eav_attribute` | |
SET `frontend_label` = "Newest" | |
WHERE `entity_type_id` = (SELECT `entity_type_id` FROM `eav_entity_type` WHERE `entity_model` = "catalog/product" AND `attribute_code` = "created_at"); |
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 | |
require_once 'app/Mage.php'; | |
Mage::app(); | |
$order = Mage::getModel('sales/order')->load(258); // order_id (not increament id) | |
$order->setState(Mage_Sales_Model_Order::STATE_NEW); | |
$order->setStatus(Mage_Sales_Model_Order::STATE_NEW); | |
$order->save(); | |
foreach ($order->getAllItems() as $item) { |
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
SET @increamentID = 'XXXXXXXXX'; | |
SET FOREIGN_KEY_CHECKS = 1; | |
DELETE FROM sales_flat_order | |
WHERE increment_id = @increamentID; | |
DELETE FROM sales_flat_quote | |
WHERE reserved_order_id = @increamentID; |
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
static NSString * BCP47LanguageCodeFromISO681LanguageCode(NSString *ISO681LanguageCode) { | |
if ([ISO681LanguageCode isEqualToString:@"ar"]) { | |
return @"ar-SA"; | |
} else if ([ISO681LanguageCode hasPrefix:@"cs"]) { | |
return @"cs-CZ"; | |
} else if ([ISO681LanguageCode hasPrefix:@"da"]) { | |
return @"da-DK"; | |
} else if ([ISO681LanguageCode hasPrefix:@"de"]) { | |
return @"de-DE"; | |
} else if ([ISO681LanguageCode hasPrefix:@"el"]) { |
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 | |
require_once "app/Mage.php"; | |
Mage::app(); | |
$installer = new Mage_Eav_Model_Entity_Setup('core_setup'); | |
$entityTypeId = $installer->getEntityTypeId('catalog_product'); | |
// replace <my_attribute_code> with your attribute code | |
$idAttribute = $installer->getAttribute($entityTypeId, '<your_attribute_code_here>', 'attribute_id'); | |
$installer->updateAttribute($entityTypeId, $idAttribute, 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
-- First, update the attribute input type to multiselect | |
UPDATE eav_attribute SET | |
entity_type_id = 4, | |
attribute_model = NULL, | |
backend_model = 'eav/entity_attribute_backend_array', | |
backend_type = 'varchar', | |
backend_table = NULL, | |
frontend_model = NULL, | |
frontend_input = 'multiselect', | |
frontend_class = NULL |
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 | |
/** | |
1. If you add your handle before you call $this->loadLayout() from a controller it’s too soon | |
2. If you add your handle after you call $this->loadLayout() it’s too late | |
So, if you really need to add a handle to a controller, you need to replace the call to $this->loadLayout() with: | |
**/ | |
$update = $this->getLayout()->getUpdate(); | |
$update->addHandle('default'); | |
$this->addActionLayoutHandles(); |
OlderNewer