0

My client would like a content type that has to be purchased by a registered user on a node-per-node basis.

A previously registered user will see a view with the available content they can purchase and then that user can purchase individual nodes. These nodes that have been purchased will also appear in a My Library view as well.

I have found multiple tutorials on how to do this via D7; however, I can't seem to find anything that shows how to do this on D8.

Can Drupal 8's Commerce Module do this out of the box or will I need to install additional modules to reach this functionality.

I am trying to find the right configurations of Products, Orders, and Stores but so far to no avail.

2 Answers 2

0

We're doing something similar.

  1. The User gets a role, that determines what he may buy
  2. A custom field on the productVariation lists which roles it is available for
  3. In a preprocess function we compare the user's roles to the accepted roles on the variation and set a flag
  4. twig evaluates that flag

Since we only have 5 products, where we have to differentiate, this works. I imagine if you had hundreds, it might be cumbersome.

0

I think the proper way to handle this in Drupal 8 would be with Commerce License.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.