Closed (fixed)
Project:
Commerce Node Checkout
Version:
7.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
29 May 2012 at 17:31 UTC
Updated:
13 Jun 2012 at 13:31 UTC
I have a scenario where I would like to charge one price for the first node created, then a different price for following ones per user.
I've created two "Create Pay to Publish" products, one for each price. I now have both of these displaying in the "Listing option" select when adding a node.
The problem I have here is the customer can choose between the prices. I would like the site to choose for them.
Is there a way to override the "Listing option" and set the value dynamically? With a hook_form_alter perhaps?
Any guidance on this would be much appreciated.
Comments
Comment #1
larowlanHey
You can use hook_form_alter to modify the #options on the field.
You can even change it to #type => value if there is only one option (and remove the choice).
Lee
Comment #2
iancawthorne commentedThanks Lee.
I've managed to come up with a solution. Posting my module code here in case it us any use for anyone else.