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
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”>
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))
Save item’s discount amount per coupon/rule in Magento
In sales_flat_quote_item and sales_flat_quote tables, discount_amount and base_discount_amount fields give you the discount amount on each item of your cart/order. However, if you have many salesrule on your item, you can’t have the discount for each rule. Avoid the rewrite
Ajaxify breadcrumbs on Magento
When you have to put varnish on a website, you may need to ajaxify the breadcrumbs. Breadcrumbs by navigation, that’s bad ! On Magento, the breadcrumbs can be different with the customer navigation. It’s not SEO-friendly for some people who say
Magento Vulnerability to patch now
SUPEE-5994 is the patch you need to install on your Magento stores (Enterprise and Community). It’s a little to late to prevent you, but i saw a lots of visitors searching for this patch on my website, so I decided
Remove Magento redirection after customer logout
In the basic behaviour of Magento, when the customer logouts, there is a special page with a redirection few seconds after. You can easy change this redirection without rewrite Magento core.
Resolving a Remote Code Execution Exploit
Magento recently identified potential exploits that: Enable an attacker to execute arbitrary code on your Magento server. Create files with a .csv extension, create writable directories, and change the permission of existing files to world-writable (777).