Do you get the error message PayPal gateway has rejected request. Billing address request is not enabled for merchant (#11601: Request for billing address failed) when trying to pay with PayPal in your Magento 2 store? You may be able…
Getting the current URL in a template (Magento 2)
The following code returns the current URL in a Magento 2 template (phtml):
|
1 |
$currentUrl = $this->getUrl('*/*/*', ['_current' => true, '_use_rewrite' => true]); |
Changing the field order of the shipping address in checkout (Magento 2)
You can adjust the order of checkout fields relatively easily with a layout update. Open the file checkout_index_index.xml in your theme, or create it if it does not exist. Then insert the following code:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
<referenceBlock name="checkout.root"> <arguments> <argument name="jsLayout" xsi:type="array"> <item name="components" xsi:type="array"> <item name="checkout" xsi:type="array"> <item name="children" xsi:type="array"> <item name="steps" xsi:type="array"> <item name="children" xsi:type="array"> <item name="shipping-step" xsi:type="array"> <item name="children" xsi:type="array"> <item name="shippingAddress" xsi:type="array"> <item name="children" xsi:type="array"> <!-- The name of the form the field belongs to --> <item name="shipping-address-fieldset" xsi:type="array"> <item name="children" xsi:type="array"> <item name="city" xsi:type="array"> <item name="sortOrder" xsi:type="string">6</item> </item> <item name="region_id" xsi:type="array"> <item name="sortOrder" xsi:type="string">3</item> </item> <item name="region_id" xsi:type="array"> <item name="sortOrder" xsi:type="string">9</item> </item> <item name="postcode" xsi:type="array"> <item name="sortOrder" xsi:type="string">5</item> </item> <item name="country_id" xsi:type="array"> <item name="sortOrder" xsi:type="string">7</item> </item> <item name="lastname" xsi:type="array"> <item name="sortOrder" xsi:type="string">2</item> </item> <item name="firstname" xsi:type="array"> <item name="sortOrder" xsi:type="string">1</item> </item> <item name="company" xsi:type="array"> <item name="sortOrder" xsi:type="string">4</item> </item> <item name="telephone" xsi:type="array"> <item name="sortOrder" xsi:type="string">8</item> </item> </item> </item> </item> </item> </item> </item> </item> </item> </item> </item> </item> </argument> </arguments> </referenceBlock> |
As you can see, you…
Save Product button not working? (Magento 2)
You click “Save Product” in your Magento 2 admin area, but nothing happens? No error message or log entry appears? Then a required field may be empty. Expand all sections and check whether a mandatory field has been left blank.…
Testing the success page
Want to test the Magento 2 success page after making some changes there without placing many orders in your Magento 2 store? By changing the following code in vendor/magento/module-checkout/Controller/Onepage/Success.php you only have to place one order. So look for the…
Deactivate / bypass maintenance mode for IP (Magento 2)
When working on your Magento 2 shop it is always a good idea to put it in maintenance mode. The only problem with this approach is that nobody, not even you :), can now work with the store. To bypass…
Disabling maintenance mode for a specific IP address (Magento 2)
Magento 2 allows you to disable maintenance mode for a specific IP address. This means you can keep using the storefront and admin area while carrying out maintenance, while other visitors see the maintenance notice. To allow your own IP…
Testing the success page (Magento 2)
To test changes to the Magento 2 order success page, open vendor/magento/module-checkout/Controller/Onepage/Success.php and comment out the line
|
1 2 |
$session->clearQuote(); // vorher //$session->clearQuote(); // auskommentiert |
. You can then reload the page as often as you like to test your changes. Remember to remove the comment once…
Updating or migrating a Magento 1 store to Magento 2
Magento 2 offers an extensively redesigned and optimized architecture, with improved performance, scalability and capabilities compared with Magento 1. However, this also means that moving from Magento 1 to Magento 2 is not a routine version upgrade. Even so, it…
Reindex URL rewrites (Magento 2)
The URL rewrites of Magento 2 will not be reindexed when rebuilding the index via command line. I recommend using https://github.com/olegkoval/magento2-regenerate_url_rewrites to include the reindex of URL rewrites on the shell. This Magento 2 extensions allows for reindexing all URL…