English post

Tous nos billets sur le thème English post

A cache example in action with Drupal 8

As we say in terms of computer programming, only two things are extremely complex: naming variables and invalidating the cache. Drupal 8 has an automatic caching system activated by default that is truly revolutionary, which makes it possible to offer a cache for anonymous visitors and especially for authenticated users without any configuration. This cache system is based on three basic concepts:

Make a SQL query on multiple tables with Drupal 8

Drupal 8 provides an API, with EntityQuery, which significantly simplifies writing SQL queries to retrieve and list a set of contents. Thus it is very easy to retrieve a list of contents according to complex criteria and conditions, without needing to know precisely the tables and their syntax for each field associated with an entity. But we may need to resort to more complex queries that involve associating data from multiple tables.

Switch from Google Maps to Leaflet and OpenStreetMap with Geolocation on Drupal 8

May 2, 2018 Google has announced a major policy change regarding the use of its online services, including its popular mapping service Google Maps and all its associated APIs, to embed or generate location-based information. This policy change now pays for a service that was previously available for free under some relatively generous quota limits starting June 11, 2018. Please read this post for full details on this policy change and its implications.

Working with the Drupal Commerce 2 checkout flows

Drupal Commerce 2 allows to define out of the box multiple checkout flows, allowing to customize according to the order, the product purchased, the customer profile this buying process and modify it accordingly. This is an extremely interesting feature, in that it can simplify as much as necessary this famous checkout flows. Do you sell physical (and therefore with associated delivery) and digital (without delivery) products? In a few clicks you can have two separate checkout flows that will take into account these specificities.

Send transactional emails related to user account in HTML format with Drupal 8

We have several solutions to automatically send emails emitted by a Drupal 8 project in HTML format. Without being able to quote them all, we can use SwiftMailer, MimeMail to send mails from the server itself, or Mailjet API, MailGun, etc. to send emails from a third-party platform. In a few clicks, we can then emit different emails, whether they are transactional (account creation, order creation, subscription, etc.) or business (Newsletters, Activity Log, What you missed, etc. .), in HTML format. It will then remain to implement one (or more) responsive email template that will be correctly read and interpreted on most mail software. And it's probably the most important part. There remains a special case: that of all the emails emitted according to the different events related to the life of a user account (Creation, Waiting for approval, Deletion, Welcome Mail, etc.). Let's see how to simply send this emails in a HTML format too.

Customize the order's activity log with Drupal Commerce 2

By default, Drupal Commerce 2 provides an activity log on the life of each order: the add to cart event, the checkout entry, the order placed, its possible shipment and its conclusion. Each status of the command corresponds to an entry in a log that is generated. This provides a complete history for each order. This activity log is generated by a small module, developed by the maintainers of Drupal Commerce 2. A small but extremely powerful module, titled Commerce log. Let's discover how to use this module to insert additional log entries.

Prevent access to untranslated pages with Drupal 8

It is not uncommon when a multilingual Drupal 8 project is implemented, that the pages translations are not ready at the time of production. If making a Drupal 8 multilingual site has become really easy to implement, there is now a fundamental difference with Drupal 7: it is impossible to disable a language. Either install a language, or delete it. This change is assumed, and voluntary, so as to not generate unnecessary complexity for questionable gain.

Apply a VAT rate on a product with Drupal Commerce 2

Drupal Commerce 2 now allows you to manage the various taxes and VAT to apply to an online store, regardless of its country and their respective rules in this area. Most of the contributed modules managing these elements on Commerce 1.x are therefore no longer necessary. Let's find out how to use the Drupal Commerce 2.x Resolver concept to set the VAT rate to apply to different products.