Something extraordinary will appear here soon

Something extraordinary will appear here soon

Read more

Clear database from tables

Read more

Fastest way to add custom category attribute to frontend menu category tree model

The simplest way to add this attribute is use XML. This sample part of code displayed below, should be inserted in Your own module in config.xml file <frontend> <category> <collection> <attributes> <custom_attribute_code/> </attributes> </collection> </category> </frontend> After that You can use this attribute, in rendering methodĀ _renderCategoryMenuItemHtml defined inĀ Mage_Catalog_Block_Navigation. Like that:

Please remember to rewrite […]

Read more

Magento custom filter on column in admin grid filter_condition_callback

Magento Grid Block has useful function for advanced filtering of a collection. It is called ‘filter_condition_callback’, and it is used in declaring a column. It takes actual collection, and callback function as parameters. Major elements:

and:

All Code:

Read more

Zend Server with XDEBUG and PHPSTORM

1. Change timeouts file: Zend\ZendServer\etc\ZendEnablerConf.xml change line with timeouts tag to: Timeouts connectionTimeout=”120″ requestTimeout=”1200″ file: Zend\ZendServer\etc\php.ini change: max_execution_time=30 to: max_execution_time=600 2. Enable vhosts file: Zend\Apache2\conf\httpd.conf uncomment Include conf/extra/httpd-vhosts.conf 3. Create new vhost file : Zend\Apache2\conf\extra\httpd-vhosts.conf You can base on exist one in this file. 4. Add new created local domain name for vhost in file: […]

Read more

Magento: List of available types column in adminhtml widget grid

date adminhtml/widget_grid_column_renderer_date datetime adminhtml/widget_grid_column_renderer_datetime number adminhtml/widget_grid_column_renderer_number currency adminhtml/widget_grid_column_renderer_currency price adminhtml/widget_grid_column_renderer_price country adminhtml/widget_grid_column_renderer_country concat adminhtml/widget_grid_column_renderer_concat action adminhtml/widget_grid_column_renderer_action options adminhtml/widget_grid_column_renderer_options date adminhtml/widget_grid_column_renderer_date checkbox adminhtml/widget_grid_column_renderer_checkbox massaction adminhtml/widget_grid_column_renderer_massaction radio adminhtml/widget_grid_column_renderer_radio input adminhtml/widget_grid_column_renderer_input select adminhtml/widget_grid_column_renderer_select text adminhtml/widget_grid_column_renderer_longtext store adminhtml/widget_grid_column_renderer_store wrapline adminhtml/widget_grid_column_renderer_wrapline theme adminhtml/widget_grid_column_renderer_theme default type adminhtml/widget_grid_column_renderer_text

Read more

How to cheat history back

Simple just like this: [javascript] <script type="text/javascript"> (function(window, location) { history.replaceState(null, document.title, location.pathname+"#!/backtocollection"); history.pushState(null, document.title, location.pathname); window.addEventListener("popstate", function() { if(location.hash === "#!/backtocollection") { history.replaceState(null, document.title, location.pathname); setTimeout(function(){ location.replace("<?php echo $_category->getUrl() ?>"); },0); } }, false); }(window, location)); </script> [/javascript]

Read more

The first step that you should do to resolve this bug is check your system.log file. In my case error looks like this: Warning: Header may not contain more than a single header, new line detected in D:\Zend\Apache2\htdocs\project1\app\code\core\Mage\Core\Model\Session\Abstract\Varien.php on line 123 Warning: Header may not contain more than a single header, new line detected in […]

Read more

Useful links

http://www.phpliveregex.com/

Read more

Sometimes, after upgrade Magento, and introducing a new template, You may not see it. Why? Because each product can have a changed template to ‘default/default’. Solutions: 1) just save product in admin panel 2) write simple SQL script, updating product attribute ‘custom_design’ to null or set it blank 3) write php code, using Magento API, […]

Read more