Tags
As I wrote earlier, I am creating a registration system using Drupal Commerce for Vejle Idrætshøjskole. For one of our course type, we need the customer to be able to select subjects during the checkout process. We decided to do it on a custom line item using custom customizable products where we added the subjects as a field.

The subjects is not the same on all of our courses on that course type, so I attached the subjects using an entityreference. Using the entityreference module under the settings for the field, I can use Views: Filter by an entityreference view to select the entities, I want to show for for the entityreference field on the custom line item on the add to cart form.
However, when using the add to cart form, I could not simply choose the current page node id for the contextual filter for the referenced entities. Instead I had to use a token to make the reference from the currently chosen product to the course display content type with the referenced subjects.
Luckily, that is possible using the patch from the issue: Dynamic Views Arguments Using Tokens. Now I was able via the settings page for the subjects field on the custom line item type to supply an argument for my view using this token: [commerce-line-item:commerce-product:product-id].
When I resolved this issue issue everything worked beautifully. How do you handle registrations with Drupal Commerce?
Kommentarer
Dynamically putting select values on a line item in Drupal
By Lacey on 18 maj 2013 at about 16:18.I do not know whether it's just me or if perhaps everyone else experiencing issues with your website. It looks like some of the text within your posts are running off the screen. Can somebody else please comment and let me know if this is happening to them as well? This could be a issue with my internet browser because I've
had this happen before. Many thanks
Tilføj kommentar