Building a webshop for customer with Drupal 7 + commerce. I've defined two price fields for commerce product entity:
1) base price (excluding tax) that is wholesale price
2) retailer price (excluding tax)
There is a rule with a condition "current user has role reseller" and action that sets retailer price as base price. This works perfectly, showing different price for logged in resellers. Also, there's a rule for tax calculation.
Now, the problem comes when trying to show both wholesale price and reseller price on the product pages including taxes. Because prices are overwritten by rules, "original" base price is not available anymore. I've tried to figure out how to do this programmatically since "Commerce price savings formatter"-module does not work with this kind of price structure. (tested price savings formatter module with discount rules, we are also using and it works well)
I'm quite lost where this should be done, should I change it in product node template (or template.php with some hook)? I can find the the original price without tax by going really deep in the content array. But I would need the tax too, at least the percent so I can do the calculations.
Any help, even tiny hints are much appreciated!
EDIT:
The working rule that sets the retailer price is defined as follows:
EVENT:
* Calculating the sell price of a product
CONDITIONS:
* User has role (=retailer)
ACTIONS:
* "Product has special price"-component
* Parameter:[commerce-line-item] (named as "product line item")
Then I have custom component "Product has special price"-component
CONDITIONS:
* Data comparison: [product-line-item:type] = Product
ACTIONS:
* Set the unit price to a specific amount
* Parameter: [product-line-item]
* Amount: [product-line-item:commerce-product:field-retailer-price:amount]