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.

Comments

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

How is this not a duplicate of #1875688: Expose price table to rules

Version:7.x-1.1» 7.x-1.0

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

Version:7.x-1.0» 7.x-1.x-dev

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

What's exactly the problem?

Also changing version of this thread to 7.x-1.0 to correct mis-labeling the original post.

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.

StatusFileSize
new96.23 KB

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

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

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

I'm note sure why rules doesn't add this checks dynamically, but that would we a rules issue).

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

Issue summary:View changes

Hi,
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