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 | |
/** | |
* Product Attribute Installer | |
*/ | |
try { | |
/* @var $installer Mage_Catalog_Model_Resource_Setup */ | |
$installer = $this; | |
$installer->startSetup(); |
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
#!/usr/bin/env ruby | |
# Batch encodes videos from a list of editing points | |
# Author: Werner Robitza <werner.robitza@univie.ac.at> | |
FFMPEG = "ffmpeg" # => path to the FFmpeg executable | |
COPY = false # => if set to true, just does a bitstream copy | |
# => if set to false, encoding options below are used | |
OVERWRITE = "-n" # => set to "-n" if you just want to keep files that exist |
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 @increment_id='300001114'; | |
select @order_id:=entity_id from sales_flat_order where increment_id=@increment_id; | |
delete from sales_flat_order where entity_id=@order_id; | |
delete from sales_flat_order_grid where increment_id=@increment_id; | |
delete from sales_flat_order_payment where parent_id=@order_id; | |
delete from sales_flat_order_status_history where parent_id=@order_id; | |
select @tax_id:=tax_id from `sales_order_tax` where order_id=@order_id; | |
delete from sales_order_tax_item where tax_id=@tax_id; | |
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(!is_numeric($_GET['id']))die('Please specify a category ID'); | |
$catId = $_GET['id']; | |
$xml = simplexml_load_file('app/etc/local.xml'); | |
$host = $xml->global->resources->default_setup->connection->host; | |
$username = $xml->global->resources->default_setup->connection->username; | |
$password = $xml->global->resources->default_setup->connection->password; |
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
### Events during order submit process | |
`core_copy_fieldset_customer_account_to_quote` | |
`core_copy_fieldset_sales_convert_quote_to_order` | |
`sales_convert_quote_to_order` | |
`core_copy_fieldset_sales_convert_quote_address_to_order` | |
`sales_convert_quote_address_to_order` | |
`core_copy_fieldset_sales_convert_quote_address_to_order_address` | |
`sales_convert_quote_address_to_order_address` |
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/design/frontend/default/your_theme/template/page/intercom-io.phtml | |
*/ | |
// Settings for the intercom.io app. | |
if( $this->helper('customer')->isLoggedIn() ): ?> | |
<?php $customer = Mage::helper('customer')->getCustomer()->getData(); ?> | |
<script id="IntercomSettingsScriptTag"> |
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
private function csvAction(){ | |
$this->disableLayout(); | |
$this->disableViewAutoRender(); | |
$obj_list = new YourObject_List(); | |
$obj_list->load(); | |
/* @var $obj Object_YourObject */ | |
$out = 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
INSERT INTO catalog_category_product | |
SELECT {{NEWCATEGORY}} as category_id, tablea.product_id, 999 as position | |
FROM `catalog_category_product` tablea | |
LEFT OUTER JOIN `catalog_category_product` tableb | |
ON tablea.product_id = tableb.product_id | |
AND tableb.category_id = {{NEWCATEGORY}} | |
WHERE tablea.`category_id` = {{OLDCATEGORY}} AND tableb.position is 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 | |
class EcomDev_Optimization_Model_Rule_Observer extends Mage_CatalogRule_Model_Observer | |
{ | |
protected $_preloadedPrices = array(); | |
public function beforeCollectTotals(Varien_Event_Observer $observer) | |
{ | |
$quote = $observer->getQuote(); | |
$date = Mage::app()->getLocale()->storeTimeStamp($quote->getStoreId()); |
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 | |
/** | |
* Optimized version of attribute source options model | |
* | |
* That allows to preload options once and reuse them instead of doing calls to db all the time | |
* | |
*/ | |
class EcomDev_Optimization_Model_Resource_Attribute_Source_Table | |
extends Mage_Eav_Model_Entity_Attribute_Source_Table |
NewerOlder