Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
We have a need where there is one price table for regular prices, and one price table for wholesale prices. Same product.
In the rule, there is no way to select which price table should replace the normal price.
The price table data itself is not exposed to rules, so there is no way to do a condition based on that. An alternative way would be to change the action for the rule, so you have to choose which price table manually. That would require a module change, however.
Any ideas or help on how I can accomplish this?
Thanks!
Comment | File | Size | Author |
---|---|---|---|
#1 | commerce_price_table.module.txt | 17.35 KB | jazzdrive3 |
#1 | commerce_price_table.rules_.inc_.txt | 2.1 KB | jazzdrive3 |
Comments
Comment #1
jazzdrive3 CreditAttribution: jazzdrive3 commentedFigured out how to do this:
Attached are the new module files, if anyone needs to see how I did this.
1. Add a new parameter to the action in commerce_price_table.rules.inc
2. Add a new parameter to the function commerce_price_table_get_amount_qty in the .module file.
3. Only add the field value to the array if the field name equals what was passed in via the new parameter.
This was easier than I thought it would be.