Skip to main content
Joachim's blog

Main navigation

  • Home
  • About

Breadcrumb

  1. Home

rules

By joachim, Fri, 21/09/2012 - 19:47

On rules versus hooks, or, abstraction shock

I need to add a bit of business logic to my Commerce site: a boolean field on product nodes marks that the corresponding products can't be delivered outside the UK.

And I know the way to do this in Commerce is to create a rule: react to the cart completing checkout, iterate over line items, check the corresponding products, and block the completion if the field in question is set.

Tags

  • rules
  • drupal planet
  • drupal commerce
rules

Frequent tags

  • Drupal Code Builder (9)
  • git (7)
  • module builder (6)
  • 6.x (5)
  • drupal commerce (4)
  • Composer (3)
  • Drush (3)
  • development (3)
  • Entity API (3)
  • Field API (3)
  • patching (3)
  • wtf (2)
  • contributing code (2)
  • maintaining projects (2)
  • code style (2)
  • contrib module (2)
  • drupal.org (2)
  • debugging (2)
  • tests (2)
  • multisite (2)
  • issue queue (2)
  • Drupal core (2)
  • core (2)
  • 7.x (2)
  • modules (2)
  • roadmap (2)
  • developer tools (2)
  • Rector (2)
Powered by Drupal