After working thru the Commerce tutorial and understanding roles, I thought it would be straightforward to set up a pricing rule based on user role, but I cannot seem to build the correct "Action" in Rules.
I want to reference a "Dealer Price" field in a Product Variation is the User Role = "dealer"
Error: Data selector commerce-line-item:commerce-product:field-dealer-price:amount for parameter amount is invalid.
Here are the steps I took to get to my current spot:
- In a custom Product Variation "Bikes", I created a new field "Dealer Price" that mirrors the "Price" field that is already part of Commerce Kickstart Dealer price Field Type: Price Widget: Price with Currency 2, Created role "Dealer"
- Initiated creation of pricing rule Store Settings >> Pricing Rules Add Pricing Rule Add Event: Calculating the sell price of a product Add Conditions: 1. User has role(s): Parameter: User: [site:current-user], Roles: dealer; 2. Entity has field: Parameter: Entity: [commerce-line-item], Field: commerce_product; 3. Entity has field: Parameter: Entity: [commerce-line-item], Field: field_dealer_price
- Then, I get stuck with Add Actions:
- Select action to add: Commerce Line Item: Set item to specific amount
- Line Item: Data Selector: commerce_line_item (Already inserted)
- Amount: [Click on Switch to Data Selector]: commerce-line-item:commerce-product:field-dealer-price:amount or commerce-line-item:commerce-product:field_dealer_price:amount or commerce-line-item:commerce-product:field-dealer_price:amount
I get an error msg when trying to reference the new price field "Dealer Price".
I feel like I am missing a connection within Commerce that ties the Product Variation to the commerce_line_item, but I haven't been able to identify the missing link. My products show up correctly in the shopping cart, so that hasn't been an issue.
Any help in tying the concepts of "Roles", "Rules", and "Commerce Kickstart" together is appreciated.
Thanks,