Magento 2 has a lot of XSD to define XML structures like config or routers. Here is a tool which convert XSD to a sample XML, usefull to visualize the structure of the file. Go to : http://xsd2xml.com/ We will
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
Declare a new Magento 2 module
Magento 2 Training : Unit 2 – Lesson A Files creation Go on file folder “app/code”, you will see a “Magento” folder. You mustn’t modifiy the content inside. All the magento core module are here, and only Magento can update
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
Install Magento 2
Magento 2 Training : Unit 1 – Lesson A Magento 2 is available after many years of waiting. Source code is on Github, and we will see how to install this new version and how to configure it.
Install sample datas for Magento 2
Magento 2 Training : Unit 1 – Lesson B The article explains how to install sample datas AFTER Magento 2 installation. If you want to do it BEFORE, show the Magento official documentation. During the web setup wizard, you can
Before Developping
Magento 2 Training : Unit 1 – Lesson C Our Magento 2 installation is done, sample datas set up, we can begin to work on our development environment. Before, I recommand you to make some configuration in order to not
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