We wiil add entires on tables “sales_order_status” and “sales_order_status_state”. In your installer, we have to put this code : <?php $installer = $this; // Our tables $statusTable = $installer->getTable(‘sales/order_status’); $statusStateTable = $installer->getTable(‘sales/order_status_state’); // Add statuses $installer->getConnection()->insertArray( $statusTable, array( ‘status’, ‘label’
Add validation on a custom shipping method
I had to create a custom shipping méthod with some conditions to be valid. I need a validation step during my checkout, and I found a method without override Magento core. In your config.xml, add the following observer : <?xml
Magento 2 : Maximum function nesting level of ‘100’ reached
If you have the error Magento 2 : Maximum function nesting level of ‘100’ reached when you goes on your Magento2 store, you need to change your php.ini file : xdebug.max_nesting_level=2000
Cancel commit with Tortoise SVN
If you commited wrong files with Tortoise SVN, don’t worry, you can easily revert changes. Do a “Show log” on your folder : On the revision history, do a right clic on the wrong revision and choose “Revert changes from
Mass update of products attribute value
Someone can ask you to change a product attribut value for every products. When you’ve got thousands of products, it can be a little complicated. Loop on a collection with a save inside is very long, and a massAction on
Manage orders display on front by state
You can easily manage orders display on front by state You need to create/modify a config.xml : <?xml version=”1.0″?> <config> <!– … –> <global> <!– … –> <sales> <order> <states> <new translate=”label”> <visible_on_front>0</visible_on_front> </new> <pending_payment translate=”label”> <visible_on_front>0</visible_on_front> </pending_payment> <processing translate=”label”>
Browse a XML file with Xpath and PHP
Xpath is an usefull language to browse a XML file easily. I will explain you the basics of this tool, with a PHP environment (From PHP 5.2.0). If you want a complete documentation, you can read this article of w3schools.com.
Memo : Conditional comments and CSS hacks (IE6, IE7, IE8, etc…)
Every HTML Integrator need to use CSS hack one time during his career. Sometimes, Internet Explorer is rebellious, or an other browser interprate a rule in his own way, it can be very useful in order to have a website
Use Skype as a web app with Unity and Chrome
Skype hasn’t got update on Ubuntu since a long time (Thanks Microsoft !), so i searched a solution in order to have a “nice” Skype version without lost features of the “software” version. I found the web version of Skype
Get attribute option value by store
What you need for this request is : – Option ID : it’s an int value of your option – Le store ID : you need the store ID to retrieve the value by store 😉 $value = Mage::getResourceModel(‘eav/entity_attribute_option_collection’) ->addFieldToFilter(‘main_table.option_id’, array(‘eq’ => $optionId))