Book Image

Getting Started with Drupal Commerce

By : Richard Jones
Book Image

Getting Started with Drupal Commerce

By: Richard Jones

Overview of this book

Drupal Commerce is emerging as the preferred option for open source e-commerce, and it also stands up to comparison against established proprietary systems. Getting Started with Drupal Commerce is an introductory guide to building an online store using Drupal Commerce in Drupal 7. Getting Started with Drupal Commerce takes you step-by-step through a complete e-commerce website build, from a clean installation of Drupal to a working example store. Starting with how to set up a Drupal development environment, we then discuss the planning of an e-commerce site and the typical questions you should be asking before getting started. Next, we walk through all of the essential setup required for most types of e-shop, including taxes, shipping, discounts and coupons, the checkout process, and backend order management. By the end of Getting Started with Drupal Commerce, you will be fully-equipped to plan and build your own store and you will understand the fundamental principles of Drupal Commerce that will enable you to progress to more complex store builds.
Table of Contents (18 chapters)
Getting Started with Drupal Commerce
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Limiting the discounts to a date range


If we want these special promotional prices to apply for a limited time only, we can add conditions to our rule. To achieve our goal, we are going to check the current date, that is the date at the moment a shopper looks at a product, to see if it is within a given date range.

We are going to add a check, such that the offer is only available in July.

Creating your rule

The following are the steps for creating your rule:

  1. From the toolbar navigate to Store | Configuration | Product pricing rules.

  2. Edit the 10 percent of everything rule. Also, add a condition.

  3. Choose Data comparison.

  4. Now, we are going to compare the current date to make sure that we are not still in June.

  5. Type site in the selection box and pick off site:current-date (that is, without the trailing dots).

  6. Click on Continue and then perform the check to see if June has passed.

  7. Since we want to compare the current date to an absolute value of June 30, rather than comparing it to the value of some other...