Drupal 8
Wow, what a great little API. Exchange Rates API is a free API that helps with currency conversion rates.
All that needs to be sent is the base currency and the currency that you want to convert. Then the conversion rate is returned. Making it simple.
Example
GET Request: https://api.exchangeratesapi.io/latest?base=USD&symbols=GBP
Result: {"base":"EUR","rates":{"USD":1.1264,"GBP":0.86168},"date":"2019-04-11"}
Cloudflare is a great tool to add another layer of security to your Drupal website.
When setup correctly Cloudflare will act as a firewall to block malicious traffic to your Drupal website at the application level. Cloudflare blocks many types of attacks: cross-site scripting, cross-site forgery requests, and SQL injection attacks. User checks can also be enabled such as GEO IP location and browser integrity checking to limit questionable or unneeded traffic.
Cloudflare also acts as a CDN and has many caching and performance features.
Recently I have been planning ahead with a couple of clients for their Drupal 7 upgrade. Drupal 7 will be supported by the community until the end of November 2021.
What does this mean for Drupal 7 projects? It means that if you haven't started planning an upgrade to Drupal 8, you should now.
The same goes for Drupal 8 and Drupal 8 will only be supported to the end of 2021 like Drupal 7, but the transition will be very easy to Drupal 9. That means by the end of 2021 each Drupal 7 and Drupal 8 project should be updated to the latest version of Drupal 8.
I recently update my modules routing.yml file and needed to update the routes in my Drupal 8 project.
Clearing the caches won't update the routes.
To update the routes run this command with Drush: drush ev '\Drupal::service("router.builder")->rebuild();'
Currently, I am working on a custom form that generates products on the fly for a custom purchase order implementation.
For this Drupal 8 commerce website, the product variations have a required weight field which was needed in the custom form.
Here is an example of the weight field.
How to apply and manage patches with composer.
First add the library 'cweagans/composer-patches' to your composer.json
Then under installer-paths in your composer.json add "patches". "Patches" is then organized by modules. Here is an example:
I have been creating a lot of custom forms for purchase order creation and custom shipping methods, using Drupal 8's form API.
For the latest form, I needed to add an autocomplete field for user accounts that filtered by a specific role.
In the example below I only needed to show users with the role of 'Supplier'
Example:
Looking for a Drupal developer? Specifically a Drupal Commerce or a backend developer? Then you came to the right place.
I am a backend Drupal developer with extensive experience working with Drupal Commerce for both Drupal 7 and 8 for over seven years now.