The following shell command (executed from your Magento 2 root folder) allows you to create a database backup of your Magento 2 store.
1 |
php bin/magento setup:backup --db |
The following shell command (executed from your Magento 2 root folder) allows you to create a database backup of your Magento 2 store.
1 |
php bin/magento setup:backup --db |
Sometimes the webservice for updating the currency exchange rates is not available and you might get the WARNING: Cannot retrieve rate from http://www.webservicex.net/CurrencyConvertor.asmx… error by mail or in some log file. This problem can be solved with the free FixerIOCurrencyImport…
By default, the Magento 2 registration form does not show address data such as the company, name or street. To change that, simply create customer_account_create.xml in the folder app/design/Your Vendor/Your Theme/Magento_Customer/layout and add the following code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
<?xml version="1.0"?> <!-- /** * Copyright © 2015 Magento. All rights reserved. * See COPYING.txt for license details. */ --> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="customer_form_register"> <arguments> <argument name="show_address_fields" xsi:type="string">1</argument> </arguments> </referenceBlock> </body> </page> |
Now just clear…
Want to add tracking information to an existing Magento shipment? Here is the code you can use:
1 2 3 4 5 6 7 8 9 |
$shipment = $order->getShipmentsCollection()->getFirstItem(); $trackingNumber = '12345678'; $track = Mage::getModel('sales/order_shipment_track') ->setShipment($shipment) ->setData('title', 'title') ->setData('number', $trackingNumber) ->setData('carrier_code', 'carrier code') ->setData('order_id', $shipment->getData('order_id')) ->save(); |
If the product images are missing after an upgrade for example, the following command (executed in the root of your Magento 2 shop) might help: php magento catalog:images:resize Note: Depending on the mumber of products, that might run some time.
The Required parameter ‘theme_dir’ was not passed is most likely caused by an invalid theme table in your database. Solution: Open the theme table and delete all rows that refer to a theme that does not exist.
If you would like to add your own library / custom PHP script to Magento, simply copy it to the /lib folder and name it the required way. Place your lib into /lib/MyOwnLib/MyLib.php for example and name the class inside…
Use the following code to get the Magento PayPal transaction ID from an order object:
1 |
$transactionId = $order->getPayment()->getLastTransId(); |
Would you like to test or style your stores success.phtml without reordering all the time? It can be done using the following temporary change: Open /app/code/core/Mage/Checkout/controllers/OnepageController.php and look for the successAction() function. Now remove the line $session->clear();. Important: Please note…
If you enable the flat categories in your Magento store, some code that gets children of a given category might stop working. The following code can be used to get all the cildren of a given category with enabled flat…