Magento admin grid column is ambiguous – filter index

Sometimes, if you use custom collection with join tables:

you’ll get an error: ‘SQLSTATE[23000]: Integrity constraint violation: 1052 Column ‘created_at’ in where clause is ambiguous’ To avoid that, use this:

Read more

Custom admin template

Add in your module config.xml file, in <config> tag: <stores> <admin> <design> <package> <name>default</name> </package> <theme> <default>custom</default> <template>custom</template> <skin>default</skin> <layout>default</layout> <locale>default</locale> </theme> </design> </admin> </stores> 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

simplexml_load_string() error in layout

Warning: simplexml_load_string(): Entity: line 29: parser error : Opening and ending tag mismatch: customer_account line 15 and layout Add : Mage::log(print_r($filename, true)); in file: app\code\core\Mage\Core\Model\Layout\Update.php at line :431

Read more

Admin 404 after transfer to other domain

Read more

Magento Indexer From Shell

[php] [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 [/php] [php] [root@root]$ php -f indexer.php help –status <indexer> Show Indexer(s) Status –mode <indexer> Show Indexer(s) Index Mode –mode-realtime <indexer> Set index mode type "Update on Save" –mode-manual <indexer> […]

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: [php] 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) { [/php] code: [php]$features[] = Product::getFeaturesStatic($productId);[/php] […]

Read more

Change in modules\blockcart\ajax-cart.js line 40 [javascript] //for category product-list page ‘add’ button… $(‘.p_add .ajax_add_to_cart_button’).unbind(‘click’).click(function(){ var idProduct = $(this).attr(‘rel’).replace(‘ajax_id_product_’, ”); var qty = $(‘.qty_ajax_id_product_’+idProduct+’ input’).val(); ajaxCart.add(idProduct, null, true, null, qty, null); return false; }); [/javascript] Change in themes\prestashop\product-list.tpl after li tag notice: remove “\{” to “{” and “\}” to “}” in this code [php] <div class="p_qty […]

Read more

Load correct product breadcrumb from front page in Magento

Change in app\code\core\Mage\Catalog\controllers\ProductController.php After: [php] $categoryId = (int) $this->getRequest()->getParam(‘category’, false); [/php] add code: [php] if($categoryId == 0){ $_product = Mage::getModel(‘catalog/product’)->load($productId); $cat_ids = $_product->getCategoryIds(); $categoryId = $cat_ids[0]; } [/php]

Read more

1. Change in modules\blockcart\blockcart.tpl after line 125: [php] <span>{l s=’Tax’ mod=’blockcart’}</span> <span id="cart_block_tax_cost" class="price ajax_cart_tax_cost">{$tax_cost}</span> <br/> [/php] add code: [php] <span>{l s=’Total without tax’ mod=’blockcart’}</span> <span id="cart_block_total_without_tax" class="price ajax_cart_total_without_tax">{$total_without_tax}</span> <br/> [/php] 2. Change in modules\blockcart\blockcart.php after line 95: [php] ‘total’ => Tools::displayPrice($totalToPay, $currency), [/php] add code: [php] ‘total_without_tax’ => Tools::displayPrice($totalToPayWithoutTaxes), [/php] 3. Change in modules\blockcart\ajax-cart.js […]

Read more