Drupal News

Valuebound: How to manipulate pricing using Order Processor in Commerce 2.x

  • Highly customizable business logic is the core of any e-commerce solution. For such functionality, Order processor comes in picture which helps us to define flexible pricing with dynamic discounts.

    In this article I will walk you through order price manipulation and use of custom adjustment to fulfill complex business logics in Drupal commerce 2.x module.

    What is Order Processor?

    E-commerce order processing is part of the order refresh process. This is executed on draft orders to ensure that it has up to date adjustments and that its order items are up to date. E-commerce order processing is a part of e-commerce workflow in drupal commerce 2.x.

    What are Adjustments in Drupal…

    2 days 21 hours ago

Weekly Drupal beginner questions thread

Droptica: Droptica: Codeception - how to start automatic tests using docker-console

  • If you read our previous posts, you already know very well how to start a project in the docker-console. If you haven’t done it yet, you should start with this article, because for the purpose of this article we assume that your project in the docker-console is already up and running, therefore all commands executed below will refer to it. In this article, we would like to introduce you to the world of automatic tests using Codeception, based on this kind of a project. Of course, not everyone has to automate all the tests on their projects, but if this will not require too much work, we bet that many people will look at a set of “smoke tests” favourably, to say the least. 

    3 days 1 hour ago

heykarthikwithu: Drupal 8 - Introduction to Plugin System and how its awesome in Drupal 8?

Newly created node content

How many pages can drupal handle?

Resolving javascript libraries conflict

Dale McGladdery: Site Reset BASH Script

  • I'm experimenting with Drupal 8 and some its new features like migration and configuration management. A reset script is a convenient timesaver and many people have shared their techniques for doing so. Having benefited from other's generosity I wanted to return the favour by sharing my current work-in-progress.

    This script:

    • Leaves the codebase as-is
    • Deletes and reinstalls the database
    • Deletes the 'files' directory
    • Deletes the specified configuration management directory
    • Enables additional modules, as required
    • Deletes settings.php and allows Drupal install to recreate
    • Updates the new settings.php $config_directories['sync'] entry
    • Adds a settings-migrate.php include to settings.php

    I call the script via Drush with an entry in drushrc.php:

    $options['shell-aliases']['428-reset'] = '!sh /Users/dale/.drush/sha-scripts/g428-reset.sh';

    The script is evolving as I learn more about Drupal 8 and refine my workflow. Comments and suggestions are welcome.

    drupal-reset.sh:

    #!/bin/bash

    # Reinstall a Drupal instance to reset it back to a know state.
    # A file base and Drush alias must already be configured.

    DRUSH8='/Users/dale/bin/drush8/vendor/bin/drush'
    DRUPALDIR='/Users/dale/Sites/group428'
    CONFIGDIR='sites/default/group42config/sync'
    DRUSHID='@g428'
    SITE_NAME='Group 428'
    ACCOUNT='admin'
    PASS='staring-password'
    EMAIL='no-reply@group42.ca'
    DB_URL='mysql://group428:group428@localhost/group428'


    # Nuke the database
    $DRUSH8 $DRUSHID sql-drop --yes

    # Nuke the filebase
    echo "Resetting files"
    chmod -R u+w $DRUPALDIR/*
    rm $DRUPALDIR/sites/default/settings.php
    rm -r $DRUPALDIR/sites/default/files
    rm -r $DRUPALDIR/$CONFIGDIR

    # Fresh Drupal install
    cd $DRUPALDIR
    $DRUSH8 site-install standard --db-url=$DB_URL --site-name=$SITE_NAME --account-name=$ACCOUNT --account-pass=$PASS --account-mail=$EMAIL --yes

    # Base configuration
    $DRUSH8 $DRUSHID en admin_toolbar,admin_toolbar_tools --yes

    # Allow upcoming changes to settings.php
    chmod u+w $DRUPALDIR/sites/default
    chmod u+w $DRUPALDIR/sites/default/settings.php

    # Configuration Management
    sed -i '' "/config\_directories\['sync'\]/d" $DRUPALDIR/sites/default/settings.php
    echo "\$config_directories['sync'] = '$CONFIGDIR';" >> $DRUPALDIR/sites/default/settings.php

    # Migrate
    echo "\ninclude 'settings-migrate.php';" >> $DRUPALDIR/sites/default/settings.php
    $DRUSH8 $DRUSHID en migrate,migrate_drupal,migrate_plus,migrate_tools,migrate_upgrade --yes

    # Login
    $DRUSH8 $DRUSHID uli Tagged: AttachmentSize Drupal Reset BASH Script1.43 KB

    5 days 15 hours ago

Using Personalization to Create Meaningful Patient Outcomes

Weekly useful Drupal things to know thread

Pages