An OSTraining member asked us how to setup the message notifications stack in Drupal.
In this particular case, he wanted to know how to set up the message notifications.
Once you install the required modules, you will notice a working notification example already exists, making the setup process easier. Let's start...
Our latest site with Drupal Commerce 1.x went live in July 2016. It is Freitag. Since then we’ve been adding several new commerce related features. I feel it’s time to write a wrap-up. The site has several interesting solutions, this article will focus on commerce.
First a few words about the architecture. platform.sh hosts the site. The stack is Linux + nginx + MySQL + PHP, the CMS is Drupal 7. Fastly caches http responses for anonymous users and also for authenticated users having no additional role (that is, logged-in customers). Authcache module takes care of lazy-loading the personalized parts (like the user menu and the shopping cart). Freitag has an ERP system to which we connect using the OCI8 PHP library. We write Behat and simpletest tests for QA.
We use the highly flexible Drupal Commerce suite. 23 of the enabled Freitag contrib modules have a name starting with ‘commerce’. We applied around 45 patches on them. Most of the patches are authored by us and 15 of them have already been committed. Even with this commitment to solve everything we could in an open-source way we wrote 30.000+ lines of commerce-related custom code. The bulk part of this is related to the ERP integration. Still, in March 2016 Freitag was the 3rd largest Drupal customer contributor.
The words ‘product’ and ‘product variation’ I’ll be using throughout the article correspond to ‘product display node’ and ‘product’ in Drupal Commerce lingo.ERP
ERP is the source of all products and product variations. We import this data into Drupal on a regular basis using Feeds. (Now I would use Migrate instead, it’s better supported and easier to maintain.) ERP also lets Drupal know about order status changes, sends the shipping tracking information and informs Drupal about products sent back to Freitag by customers.
There is data flowing in the opposite direction as well. ERP needs to know about all Drupal orders. Also, we create coupons in Drupal and send them to ERP too for accounting and other reasons.Emails
We send commerce-related emails using the Message stack. This way we can have order-related tokens in our mails and we can manage and translate them outside the Rules UI. Mandrill takes care of the mail delivery.Payment gateway
It was a client requirement to use the Swiss Datatrans payment gateway. However, at the time of starting the project, Commerce Datatrans (the connector module on drupal.org) was in dev state and lacked several features we needed. Pressed for time we opted for buying a Datatrans Drupal module from a company offering this solution. It turned out to be a bad choice. When we discovered that the purchased module still does not cover all our needs and looked at the code we found that it was obfuscated and pretty much impossible to change. Also, the module could be used only on one site instance which made it impossible to use it on our staging sites.
We ended up submitting patches to the Commerce Datatrans module hosted on drupal.org. The module maintainer, Sascha Grossenbacher (the well-known Drupal 8 core contribtor) helped us solving several issues and feature requests by reviewing our patches. This process has lead to a stable release of Commerce Datatrans with a dozen of feature improvements and bugfixes.
Additional to Datatrans we use Commerce Custom Offline Payments to enable offline store purchases by store staff and bank transfer payments.Currencies
The site works with 7 different currencies, some of them having two different prices depending on the shipping country. Prices come from ERP and we store them in a field collection field on the product. We do not use the commerce_price field on the product variation.Tax
Freitag ships to countries all around the world. VAT calculations are performed for EU, Switzerland, UK, Japan, South Korea and Singapore. To implement this functionality our choice fell on the commerce_vat module. Adding commerce_eu_vat and commerce_ch_vat released us from having to maintain VAT rates for EU and Switzerland ourselves. For the 3 Asian countries we implemented our own hook_commerce_vat_rate_info().
We have two different VAT rates for most of the countries. This is because usually a lower VAT rate applies to books. Drupal imports the appropriate VAT rate from the ERP with the product variation data. This information is handled by price calculation rules in Drupal.Shipping
Freitag delivers its products using several shipping providers (like UPS, Swiss Post) all around the world. Most shipping providers have many shipping rates depending on the destination country, speed and shipped quantity (weight or volume). On checkout the customer can choose from a list of shipping services. This list needs to be compatible with the order.
We used rules to implement the shipping services in Drupal based on the Commerce Flat Rate module. For this end we trained our client to set up and maintain these rules themselves. It was not easy: shipping rules are daunting even for experienced commerce developers. First we needed to set up the “Profile Address” rules components. Then we configured the “Place of Supply” components. We applied these in turn in the condition part of the shipping rules components themselves.
The weakest point of any implementation based on Rules is the maintenance. It’s not easy to find a specific rule after you created it. Having 250 rules components for only shipping made this feeling stronger.
The shipping line item receives the VAT rate of the product with the highest VAT rate in the order.Coupons
Freitag has 6 different coupon types. They differ in who can create them, who and where (online/offline) can redeem them, whether partial redemption is possible, whether it’s a fixed amount or percentage discount and whether Freitag accounting needs to know about them or not.
Based on these criteria we came up with a solution featuring Commerce Coupon. Coupons can be discount coupons or giftcards. Giftcard coupons can only have a fixed value. Discount based coupons can also apply a percentage discount. The main difference between them is that customers can partially redeem giftcards, while discount-based coupons are for one-time use.
To make coupons work with VAT was quite tricky. (To make things simpler we only allowed one coupon per order.) Some coupon types work as money which means that from an accounting point of view they do not actually decrease the order total (and thus the VAT) but work as a payment method. Other coupon types however do decrease the order total (and thus the VAT). At the same time Drupal handles all coupons as line items with a negative price and the Drupal order total does decrease in either case.
The solution we found was to use Commerce proportional VAT. Axel Rutz maintains this brilliant little module and he does this in a very helpful and responsive manner. All the module does is adding negative VAT price components to coupon line items to account for VAT decrease. It decreases the order total VAT amounts correctly even if we have several different VAT rates inside the order.Conclusion
Although there’s always room for increasing the complexity of the commerce part of the site (let’s find some use case for recurring payments!), it’s already the most complicated commerce site I’ve worked on. For this Drupal Commerce provided a solid foundation that is pleasant to work with. In the end, Drupal enabled us to deliver a system that tightly integrates content and commerce.
If you haven’t noticed from our Twitter feed this week we’ve flown the team to Minsk in Belarus to socialise, eat, drink and be merry while maybe taking in a little culture and even some work(!)
One of the first things that we all notice when the team get together is you can’t hug someone over Skype… you can’t make the other person a cup of tea, or complain about the same weather.
While distributed teams can pick the world’s finest global talent as far as timezones and personal or client flexibility allows, meeting in person is a necessary task to undertake on a regular basis. It’s not essential that everyday is spent this way and removing the ability to choose from only your local talent, or those willing to relocate is not the most sensible choice in our modern era of collaborative tools and communication methods. We’d still much rather be distributed but greatly appreciate these times together.
We’ll continue to blog through the week and Tweet some extras as they are happening.
From all of us in our temporary Minsk HQ - have a fun and productive day and if you are sat next to a colleague give them a hug or make them a cup of tea. Not all teams can enjoy this luxury every day of their work life.
Menu Hide Disabled Parents helps to simplify the menu parent selection on node edit forms. The idea is simple. All menu items with text "(disabled)" are hidden after enabling this module. No configuration is needed.i18n support
If you have i18n multilingual site this will also hide items not in the current language.
Development sponsored by Data Group Finland.
As a creative fiction writer, I’ve never had a problem coming up with unique and compelling backstories for my characters. I usually scribble down a page or three of backstory for each PC I create and for most of my major NPCs as well. When I get super invested in a character, the background can swell to many more pages than that. However, I’ve run into a quite a few players in the past that struggle with backgrounds. Conversations with them usually go something like this:
Me: What is your character?
Player: An elven ranger.
Me: What did your character do before she became a ranger?
Player: Trained to become a ranger.
Me: Okay… how about before that?
Player: She frolicked with the other elven children in the forests.
Me: Tell me about the other elven children. Is your character still in touch with any of them? How about your family?
Player: *blank look*
I fully realize not everyone is invested in crafting a character background to share with the GM or other players. That’s perfectly fine, but a well-crafted background can allow the GM to hook the player deeper into the story. It also allows the GM to see where the storyline they have planned can be adjusted to fit in pertinent details the player provides. When the plot stakes personally involve the character, the depth of interest the player has for the game increases. This leads to greater immersion for everyone at the table.
If a player is genuinely interested in crafting a background, but struggles with it, there are two approaches to assisting them.Questions to Answer
The first approach is to interview the character (not the player), and ask probative questions about their past. These types of questions can be:
- What is your greatest fear?
- What is your greatest desire?
- Who kept you from accomplishing a goal in the past?
- Who helped you out the most in the past?
- Who owes you a favor? Why?
- Who do you owe a favor to? Why?
- What love interest(s) have you had in the past? Are they still involved in your life?
- What is your darkest secret?
… And so on. These are all probative questions that can assist the player in opening up and experiencing the character’s point of view before any time is spent at the game table.Details to Choose From
If the interview process fails or locks up the player’s brain, then they probably need a more precise creative compass. An overly creative person still needs direction to guide them through the creation process. A creative compass actually provides limitations on where creativity can go. It can also give a spark of an idea to someone drawing a complete blank on how to describe their character’s past. I used to have a set of 50+ index cards with various character details on them, but they were lost in a move many moons ago. I’ll recreate some of my favorites here to give you an idea of what kind of prompts I used to give my players. I’d generally pull out three at a time, show them all three, and let them pick one. I’d repeat this process a few times until we had four or five quality details about the character’s past. This was generally enough to allow the player to fill in the middle parts and produce a decent background.
Where words are split by a slash (/), I allow the player to pick one of the options and continue on. I urge them not to overthink the ramifications of their choice. Where there is a blank, the player gets to fill in the blank. Some of the blanks have suggestions on how to fill it out.
- I saved my younger/older sister/brother from _____.
- My mom/dad died at the hands of Proper Name Here when I was a child/teenager.
- My favorite place to visit is_____.
- I would love to be able to_____ before I die.
- My darkest secret is that I killed/maimed a friend/lover during an argument.
- My most prized possession is a bauble given to me by my favorite aunt/uncle.
- My Distant Family Member Here is a famous/infamous powerful mage living in the wilds.
- I have a scar on my Body Part Here from an encounter with a Insert Monster Here.
- The first time I saw real magic happen, I was scared/intrigued/amazed/disinterested.
- Insert Name Here stole _____ from my family, and I’d do almost anything to get it back.
How do you guide your players through their background creation when they stumble along the way? I’d love to hear your ideas for assisting others with creating their backgrounds. For those of you that are interested, I have my own character workbook I use for my fiction writing. I don’t always fill it out to completion, but I will do enough of it to give me a solid idea of who and what my characters are. You can find the full workbook on my author web site under the Writing Tools section.
This is Landing Page Constructor Tool with open architecture that allow to add new components easily and quickly.
You can manipulate with set of Paragraphs to create your Landing Page.
I'm working now on tutorial how to add new custom components.
Project is in active development.
If you are using a composer library that needs a DBAL connection, this module provides a factory service that lets you inject that into your services.
Provides developer tools for using Drupal as a development framework for building Eloqua App Cloud applications.
UKIE calls on the UK government to institute eSports diversity initiatives, better regulation and installation of "superfast broadband" that would make the UK competitive with hubs like South Korea. ...
Drupal Modules: The One Percent: Drupal Modules: The One Percent — Configuration Split (video tutorial)
Here is where we look at Drupal modules running on less than 1% of reporting sites. Today we'll look at Configuration Split, a module which allows you to export only the D.8x configuration you want to production. More information can be found http://nuvole.org/blog/2016/nov/28/configuration-split-first-beta-release-drupal-ironcamp.