I'm trying to use the fresh new Digital Products plugin in my website.

I managed to create some products and assigned licenses, I see some licenses when I log in as an end user - but the last link is missing.

What is the process of getting a specific product object in my "digital product detail page", adding it into the order along with other products, paying and getting the license auto generated?

1 Answer 1


You would start out by listing the digital products in your templates. For example, if you had digital product type with the handle of onlineCourses, you would get the list of products like this:

{% set products = craft.digitalProducts.products({type: 'onlineCourses'}).order('price desc') %}

Looping through those is just like looping through variants (since digital products don't have variants) or entries. One thing to note, is that currently digital products do no have a salePrice, if you've been using that for Commerce products - just price.

You would add digital products to the cart exactly like you would add a Commerce product and, as soon as an order is completed, any digital products that were in the order will have their licenses automatically generated.

Please note, unlike Craft Commerce standard products where the purchasable is the products' variant, in the case of Digital Products, the purchasable is the product itself.

For example:

<input type="hidden" name="purchasableId" value="{{ product.defaultVariant.purchasableId}}"/>


<input type="hidden" name="purchasableId" value="{{ digitalProduct.purchasableId}}"/>

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.