Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Getting Started with Drupal Commerce

You're reading from   Getting Started with Drupal Commerce Learn everything you need to know in order to get your first Drupal Commerce website set up and trading

Arrow left icon
Product type Paperback
Published in Sep 2013
Publisher Packt
ISBN-13 9781783280230
Length 152 pages
Edition 1st Edition
Tools
Concepts
Arrow right icon
Toc

Table of Contents (18) Chapters Close

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...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image