Magento sent an email to every partners to prevent about a new malware issue. This malware is inside a script and contains words like “onepage” or “checkout”. Hackers use admin acess or database access to implement this code. Magento doesn’t
Cancel addStatusHistory with an Observer
Create a new observer on the config.xml of your module : <events> <sales_order_save_before> <observers> <mypackage_mymodule_cancel_add_history> <class>mymodule/observer</class> <method>cancelAddHistory</method> </mypackage_mymodule_cancel_add_history> </observers> </sales_order_save_before> </events> Create this observer : <?php class Mypackage_Mymodule_Model_Observer { public function cancelAddHistory(Varien_Event_Observer $observer) { $order = $observer->getEvent()->getOrder(); // My logic
Magento 2.0.1, Magento CE 1.9.2.3, Magento EE 1.14.2.3 Updates (PATCH SUPEE-7405, PATCH SUPEE-7616)
Magento 2.0.1 update Go on the root folder of your Magento 2 installation and launch git pull If you have a message like : error: Your local changes to the following files would be overwritten by merge: [..] Please, commit
Magento bug when displaying creditmemo with giftcard
I found a minor bug in Magento’s admin layout, when a giftcard amount is refunded. When you are creating your refund, the giftcard amount is displayed. But, if you update quantities or when you display your creditmemo, the giftcard amount
Magento hacker alert (GuruIncsite Infection – Patch SUPEE-6788 Installation)
12-07-2015 Update : Magento security patch SUPEE-6788 – Installation (and issue with htaccess) + Enable patch functionnalities 10-28-2015 Update : Download the security patch SUPEE-6788 10-22-2015 Update : How to modify your custom modules to the next security patch ?
Correct created_at and updated_at columns issue
Tables which have created_at and updated_at columns are not correct on some native Magento. created_at field has got CURRENT_TIMESTAMP as default value, and this is correct. But it also has an option ON UPDATE CURRENT_TIMESTAMP which is totally wrong and
Debug confirmation order email
With the following code, you can send any order email with the order ID, on any email adress. It’s usefull when you want to test and debug confirmation order emails Create text.php file on your magento server root and add
Get a product’s attribute without load (with label)
Sometimes, you need to get a precise information about a product, and it’s very boring to load it. Two methods are possible : Collection method $productId = 25; // Your product ID $model = Mage::getModel(‘catalog/product’) ->getCollection() ->addAttributeToSelect(‘attribute_code’) ->addAttributeToFilter(‘entity_id’,$productId) ->getFirstItem(); $attribute_value
Easily update object’s attributes without save (orders, products etc…)
To update an attribute like order attribute, product attribute etc…, without save, here is the solution : $order->setMyAttribute($myValue); $order->getResource()->saveAttribute($order, ‘my_attribute’);
Change shipping description (Shipping & Handling Information)
Few month ago, I had to modify custom shipping description, and make it dynamic. A first solution was to override the getShippingDescription method in my module. But it’s a little creepy because it used an override. Finally, I found a