Upgrade Magento from 1.3, 1.4 .. to latest via ssh

1. chmod -R 777 lib/PEAR 2. ./pear mage-setup 3. ./pear upgrade -f magento-core/Mage_All_Latest-stable 4. chmod 550 ./mage 5. ./mage mage-setup . 6. If You have got an error: “Channel ‘community’ already exist!” try this: php -f downloader/mage.php channel-delete community 7. ./mage sync 8. ./mage list-upgrades 9. ./mage config-set preferred_state stable 10. ./mage upgrade-all –force 11. […]

Read more

Simple Configurable Products index price error

Simple Configurable Products module from Organic internet is one of better solution for display configurable products. However, Magento 1.7.0.2 not supported it completely. To make it work, you simple should add in file: app\code\community\OrganicInternet\SimpleConfigurableProducts\Catalog\Model\Resource\Eav\Mysql4\Product\Indexer\Price\Configurable.php after(:87) ‘group_price’        => new Zend_Db_Expr(‘pi.group_price’), this code: ‘base_group_price’    => new Zend_Db_Expr(‘pi.group_price’) and in file: app\code\community\OrganicInternet\SimpleConfigurableProducts\Catalog\Model\Resource\Eav\Mysql4\Product\Indexer\Price.php change: $this->cloneIndexTable(true); to: $this->clearTemporaryIndexTable();

Read more

Magento admin grid column is ambiguous – filter index

Sometimes, if you use custom collection with join tables: protected function _prepareCollection() { $collection = Mage::getModel(‘sales/order_item’)->getCollection() ; $collection->getSelect()->join( array(‘sfo’=>’sales_flat_order’),’sfo.entity_id=main_table.order_id’,array(‘sfo.increment_id’, ‘sfo.status’, ‘sfo.shipping_description’, ‘sfo.base_shipping_amount’)); $collection->getSelect()->join( array(‘e’=>’catalog_product_entity’), ‘main_table.sku = e.sku’, array(‘e.sku’)); $this->setCollection($collection); return parent::_prepareCollection(); } you’ll get an error: ‘SQLSTATE[23000]: Integrity constraint violation: 1052 Column ‘created_at’ in where clause is ambiguous’ To avoid that, use this: $this->addColumn(‘created_at’, array( […]

Read more

Custom admin template

Add in your module config.xml file, in tag: default custom custom default default default Create new catalogs, such like as: app/design/adminhtml/default/custom app/design/adminhtml/default/custom/template app/design/adminhtml/default/custom/layout And do what you use to do with frontend template 🙂

Read more

Admin 404 after transfer to other domain

SET FOREIGN_KEY_CHECKS=0; UPDATE `core_store` SET store_id = 0 WHERE code=’admin’; UPDATE `core_store_group` SET group_id = 0 WHERE name=’Default’; UPDATE `core_website` SET website_id = 0 WHERE code=’admin’; UPDATE `customer_group` SET customer_group_id = 0 WHERE customer_group_code=’NOT LOGGED IN’; SET FOREIGN_KEY_CHECKS=1;

Read more

Magento Indexer From Shell

[root@root]$ pwd /home/mcomerce [root@root]$ ls access-logs etc perl5 public_ftp ssl www cpbackup-exclude.conf mail php.ini public_html tmp [root@root]$ cd public_html/shell [root@root]$ ls abstract.php compiler.php indexer.php log.php [root@root]$ php -f indexer.php help –status Show Indexer(s) Status –mode Show Indexer(s) Index Mode –mode-realtime Set index mode type "Update on Save" –mode-manual Set index mode type "Manual Update" –reindex […]

Read more

Magento Events List

Location Line Event cron.php 44 default app/code/core/Mage/Adminhtml/Controller/Action.php 151 adminhtml_controller_action_predispatch_start app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Carts.php 61 adminhtml_block_html_before app/code/core/Mage/Adminhtml/Block/Report/Grid.php 186 adminhtml_widget_grid_filter_collection app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Meta.php 76 adminhtml_cms_page_edit_tab_meta_prepare_form app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Design.php 125 adminhtml_cms_page_edit_tab_design_prepare_form app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Main.php 117 adminhtml_cms_page_edit_tab_main_prepare_form app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Content.php 98 adminhtml_cms_page_edit_tab_content_prepare_form app/code/core/Mage/Adminhtml/Block/Widget/Container.php 307 adminhtml_widget_container_html_before app/code/core/Mage/Adminhtml/Block/Template.php 80 adminhtml_block_html_before app/code/core/Mage/Adminhtml/Block/Sales/Reorder/Renderer/Action.php 55 adminhtml_customer_orders_add_action_renderer app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tabs.php 154 adminhtml_catalog_category_tabs app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php 284 adminhtml_catalog_category_tree_is_moveable app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php 321 adminhtml_catalog_category_tree_can_add_root_category app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php 341 adminhtml_catalog_category_tree_can_add_sub_category app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/New/Product/Attributes.php 64 adminhtml_catalog_product_edit_prepare_form app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/New/Product/Attributes.php 80 adminhtml_catalog_product_edit_element_types app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main.php […]

Read more

Simple way to add each product feature in shopping cart page. 1. Change in controllers\ParentOrderController.php in line 244 after: protected function _assignSummaryInformations() { global $currency; if (file_exists(_PS_SHIP_IMG_DIR_.(int)(self::$cart->id_carrier).’.jpg’)) self::$smarty->assign(‘carrierPicture’, 1); $summary = self::$cart->getSummaryDetails(); $customizedDatas = Product::getAllCustomizedDatas((int)(self::$cart->id)); // override customization tax rate with real tax (tax rules) foreach($summary[‘products’] AS &$productUpdate) { code: $features[] = Product::getFeaturesStatic($productId); and after: […]

Read more