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.
It would be useful if price tables supported multiple fields so that one could configure their products to support different bulk pricing rules based on user role.
Attaching a patch which configures an additional rules action to enable someone to specify a table (currently using text value) to use for adding the commerce_price_table to the line item.
Comment | File | Size | Author |
---|---|---|---|
#5 | price_table_rules_action_error.png | 96.23 KB | bjcone |
rules_select_price_table.patch | 3.45 KB | bjcone |
Comments
Comment #1
jazzdrive3 CreditAttribution: jazzdrive3 commentedThis module actually use to have this feature in the rule. You selected which price table field to use. Not sure why it was taken out. I'm glad I didn't inadvertently upgrade, because it would have broken wholesale functionality on a site.
This is definitely needed functionality.
However, this patch does apply to 1.1 at all. Line numbers are all wrong. Was this rolled against 1.1?
Another alternative would be to merge 1.0 and 1.1, since it looks like 1.0 had this functionality.
Thanks.
Comment #2
pcambraHow is this not a duplicate of #1875688: Expose price table to rules
Comment #3
bjcone CreditAttribution: bjcone commentedIt looks like the request is a duplicate. However, after downloading the latest dev version of commerce_price_table, I cannot get the rule to select a table to work. Perhaps I'm missing something...
Also changing version of this thread to 7.x-1.0 to correct mis-labeling the original post.
Comment #4
pcambraWhat's exactly the problem?
That's not how tags work on VCS, changes are always applied to -dev and at some point a release is tagged, no way to go back and change 1.0.
Comment #5
bjcone CreditAttribution: bjcone commentedSure, I understand that you can't re-release 1.0. I was changing the version tag of this so that people wouldn't try to patch the wrong version, see #1.
As for the problems I am having with -dev: When I try to update the default rule provided with the module, I am unable to select a price table. I updated the conditions as appropriate for my configuration and tables, however, when I try to update the action to select my price table, the selection fails. Due to the argument type, you are only able to use the rules Data Selector yet cannot select the proper value to properly configure the action.
Attaching a screenshot of the configuration error.
Comment #6
pcambraAs for #1, there is no diff between the rules integration of 1.0 and 1.1 and definitely a merge is not possible as I explained in #4
1.0
http://drupalcode.org/project/commerce_price_table.git/blob/5b119e99c0ca...
1.1
http://drupalcode.org/project/commerce_price_table.git/blob/5b119e99c0ca...
So I'm confused about that.
The error you screenshot is interesting, I'll definitely take a look to that because the price table selection is something brand new from -dev version and wasn't there before, unless we're talking about two different things.
Comment #7
Cybso CreditAttribution: Cybso commentedPlease ensure that you've added an "Entity has field" condition for field-wholesale-price. Got the same error when I forgot to add this condition (rules' actions can only apply to known fields. I'm note sure why rules doesn't add this checks dynamically, but that would we a rules issue).
Comment #8
pcambraThat's by design of rules module, basically it would totally kill performance. Imagine rules loading every field data of a given entity even if it's not needed.
You can easily alter your entity info in code (hook_entity_info_alter) to expose fields to rules interface, check how commerce order loads price total an line items using this technique.
Comment #9
Summit CreditAttribution: Summit commentedHi,
I would love if commerce price table module would support more price tables like the header of this issue asks for.
For my situation I have services which have a different price based on the quantity of the order.
So I have one price table for the base price, which is different per quantity: 1<200, price is 10 euro, 201<400, price is 8 euro, 401<600, price is 6 euro.
And I need (more than one) other price table which gives the prices of the service based on the quantity: for 1<200, service is 5 euro, 201<400, service is 4 euro, 401<600 service is 3 euro etc...
For an order of a quantity of 500 pieces the price is 500*6 + 500 *3 = 4500 euro.
Being able to set this per product and attached services as references with price table in line items would be great!
Sorry if with this request I hijack this issue, but I thought it was very much related to having "more than one pricetable"
Greetings, Martijn
Comment #10
Andreas Radloff CreditAttribution: Andreas Radloff commentedTry this module: Commerce Pricelist
Comment #11
Summit CreditAttribution: Summit commentedHi Andreas, I will definitely do! Will give feedback on: https://www.drupal.org/project/commerce_pricelist
Thanks for sharing!
Greetings, Martijn
Comment #12
geek-merlinThe issue about multiple price tables is fixed for me via #2918572: Price table alters itself, preventing multiple price tables.