• Development

    Drupal Commerce Add To Cart Form Tweaks / Registration Improvements

    In this example I’m showing how to improve the Add to Cart button for Drupal Commerce products to show differently based on whether or not users have already purchased a product, or whether the product is already in their cart.

    I’m currently working on a site where users are registering for “programs,” which are synonymous with classes, courses, etc. I’m using the following modules (among others) in this example:

    • Drupal Commerce
    • Registration
    • Commerce Registration

    Please understand that when a user registers for a course, they are actually purchasing a product that has a referenced Registration entity.

  • Development

    Views Exposed Filter: Terms for current language only

    I’ve been working on a multilingual site that has a product finder. We have 3 exposed filters that allow a user to select an Activity, IP Category, or Industry. All of these filters are Taxonomy Term filters. Some of the terms throughout those vocabularies have a specific language set, and should only show when that language is active.

    The first step is to make sure the output (Views results) only shows products where the node language matches the current language. This is easy using the built in Node translation: Language = Current user’s language filter.