Doing this for a particular order is pretty straightforward. All you need to have is the coupon code ID:
Sooner or later you will encounter an issue in Drupal core or contrib project that has been fixed but the update has not been included in an official release.
This article explains how to add patches to your
composer.json so they get applied whenever you update or install the project from scratch.
Separate JS files are good but in certain cases (e.g. tracking scripts) it might be useful to just add a piece of inline code to a specific page.
This can easily be achieved from a custom module by implementing
hook_page_attachments(), checking the page you are on and adding the JS code to the HTML head.
Every here and then Drupal cron will get stuck due to an issue in code, configuration, timeout of one of the services on the server or simply due to a bug.
Creating Nodes is as simple as creating other entities in Drupal 8. When you have Pathauto installed, you can also create a custom alias and pass a flag for Pathauto so it does not overwrite it with current set of rules.
This can be useful when you need to programmatically create nodes that must have a strict URL that doesn't match the Pathauto patterns.
Below is a simple code snippet that allows you to convert a password hashed using MD5 into the format that can be used by Drupal 8. This can be useful if you are creating users programmatically and need to re-create their password from an MD5 source.
For some reason there is no standardized WordPress .gitignore file that can be kept in the project root. After going back to my own boilerplates for 100th time, I figured I might as well post that here and on Github.
The code is below and Github repo is github.com/aramboyajyan/wordpress-gitignore. Rules work on the principle that they first exclude all plugins and themes, and then declare the directories with custom code that you want to keep under version control.
Quite a block of code but gives you more flexibility in the end. The code below does not load current user's shopping cart, but shopping cart of the super user (UID: 1).
Just run these two commands: