Drupal Planet

Customizing the address fields on Drupal Commerce checkouts

I ran into a problem recently where, on the checkout form, a Drupal 10 site running Commerce wanted to have the addresses always put the customer's name before the company name.

After digging into it I first opened a support request for the Addressing library from Commerce Guys / Centarro. After a little more digging I worked out a pull request that changed the address formats for all countries to have the customer's name before the organization.

Tags: 

Debugging why a block doesn't display

Recently I was tying myself in knots trying to work out why certain blocks weren't displaying. Long story short, the problem ended up coming from a custom condition plugin that didn't cover for enough use cases.

I ended up tracking down the problem by debugging my way through the block condition logic. In BlockRepository::getVisibleBlocksPerRegion() it checks the access logic for each block

Tags: 

Grouping Simple Sitemap by content type

The XML sitemap standard has been around for almost 20 years and serves as a great way of keeping Google and other search engines up to date on what content is changing on a website. Thanks to the world of open source, sites which use Drupal have tools to automatically generate the files based upon the site's content, e.g. Simple Sitemap, instead of having to manually create them.

Tags: 

Pages

Subscribe to Drupal Planet