3
Answers
Vote up!
1
Vote down!

Need help on Product pricing rules

Hi,

I'm stuck, hope someone can help me.
I want to create a product pricing rule. The price of a particular product should be divided by two on the 30th off june.
I followed this instruction video: http://www.drupalcommerce.org/videos/tutorials/drupal-commerce-datebased....

What I've got so far:
{ "rules_halveer_prijs_lidmaatschap_op_30_juni" : {
"LABEL" : "Halveer prijs lidmaatschap op 30 juni",
"PLUGIN" : "reaction rule",
"REQUIRES" : [ "commerce_line_item", "commerce_product_reference" ],
"ON" : [ "commerce_product_calculate_sell_price" ],
"DO" : [
{ "commerce_line_item_unit_price_divide" : {
"commerce_line_item" : [ "commerce-line-item" ],
"amount" : "2",
"component_name" : "base_price",
"round_mode" : "0"
}
}
]
}
}

This works but I can't get the date filled in.
I've chosen Add Action - Data Comparison and then site:current-date, and value is greater than and after that i'm stuck. There is no data selector for a specific date.

regards, Pip

Asked by: PipB
on December 20, 2012

3 Answers

Vote up!
0
Vote down!

Seems to me that through the interface this is doable.

You don't want to add this as an 'Add Action'.

You want the date to be a 'Condition' under the rules.

When you select 'Condition', you'll select 'site:...'

From there you select 'site:current-date'

Then it will ask you the date to compare it to, which will be the 30th of June.

Remember: Condition.

The Action would be the discount itself. ;-)

Answer by: knowprose
Posted: Dec 20, 2012
Vote up!
0
Vote down!

Thanks for your answer,
I'm so sorry, I ment to write CONDITION, not action.

I can see a date as long as the Value is Equals, when I change the value to Is Greater Than this datefield disappears and I only have Data Selectors.

regards, Pip

Answer by: PipB
Posted: Dec 21, 2012
Vote up!
0
Vote down!

Pfff I found it and it was unbelievably simple...
I clicked: Switch to direct input and then I was able to fill in the date.
How simple can life be...

Merry Xmas!
Pip

Answer by: PipB
Posted: Dec 21, 2012