Adobe Commerce - Improved Magento Vars Store Code Configuration

The default magento-vars.php file that is referenced through the Adobe Commerce documentation leaves a lot to be desired and can become a pain when managing stores with many websites and store views. Luckily we can simplify this configuration using the match implementation within PHP8. This version of the script allows us to configure new store fronts by adding a single case to the match statement. <?php $host = $_SERVER['HTTP_HOST'] ?? ''; $ephemeralHostScope = fn(string $host): ?...

April 29, 2024 · 1 min · 150 words · Me

Magento 2 - Elasticsearch 8 _id indices in Warden

This post explains how to set custom Elasticsearch configuration within Warden to fix the Fielddata access on the _id field is disallowed error with Elasticsearch 8. This is a follow on from a earlier post explaining common ES8 configuration issues with Magento. The error was are going to fix related to ES8 changing the default values for _id fielddata Fielddata access on the _id field is disallowed, you can re-enable it by updating the dynamic cluster setting: indices....

April 24, 2024 · 1 min · 130 words · Me

Magento 2 - Elasticsearch 8 Missing Products

Have you upgrade to Magento 2.4.6 recently for the improved performance / support lifetime? Or maybe you have upgraded to 2.4.7 where Elasticsearch 8 is the only supported Elasticsearch Version now. We have spotted a major issue post update, where your catalog and search pages might be looking a little sorry for themselves… with ZERO products! Not ideal. There are a few configuration changes that are required to get Elasticsearch 8 to play nicely with Magento, that are easily overlooked in the upgrade notes (or absent entirely!...

April 24, 2024 · 3 min · 495 words · Me

Magento 2 - Configuring Nginx Rate Limiting

Configuring Nginx rate limiting for Magento is both simple to get started, but complex to find the right balance. It is a great way to combat malicious traffic from web scrapers/crawlers, and less respectful 3rd party integrations. The default nginx status code for the limit is 503, it is important to change this to HTTP 429 Too Many Requests. HTTP 429 is the standard rate limiting code, and should prevent any negative indexing results with search engines, and as a bonus any bots should slow their crawl rate (if they respect the response code)....

April 3, 2024 · 3 min · 472 words · Me

Comparing Magento 2 DB Schema Changes

Recently I came across an issue on a site where the setup:db:status would constantly report Declarative Schema is not up to date even after consecutive runs. This was breaking the zero downtime deployment configuration for the store, as the CD process always saw DB updates to process. There seemed to be (at least at the time of writing) very little information / tooling on how to debug db schema issues. So after a bunch of reverse engineering Magento’s implementation of DB Schema, I ended up creating a simple script that compares the current DB schema with the current configuration in the compiled db_schema....

November 12, 2023 · 2 min · 391 words · Me