Browse Source

docs: Add missing step to digital products guide

Michael Bromley 1 year ago
parent
commit
73715a157f
1 changed files with 22 additions and 0 deletions
  1. 22 0
      docs/docs/guides/how-to/digital-products/index.mdx

+ 22 - 0
docs/docs/guides/how-to/digital-products/index.mdx

@@ -157,6 +157,28 @@ function generateDownloadUrl(orderLine: OrderLine) {
 }
 }
 ```
 ```
 
 
+This fulfillment handler should then be added to the `fulfillmentHandlers` array the config ShippingOptions:
+
+```ts title="src/plugins/digital-products/digital-products-plugin.ts"
+
+import { LanguageCode, PluginCommonModule, VendurePlugin } from '@vendure/core';
+import { digitalFulfillmentHandler } from './config/digital-fulfillment-handler';
+
+@VendurePlugin({
+    imports: [PluginCommonModule],
+    configuration: config => {
+        // config.customFields.ProductVariant.push({ ... omitted
+        // config.customFields.ShippingMethod.push({ ... omitted
+        // config.customFields.Fulfillment.push({ ... omitted
+        // highlight-start
+        config.shippingOptions.fulfillmentHandlers.push(digitalFulfillmentHandler);
+        // highlight-end
+        return config;
+    },
+})
+export class DigitalProductsPlugin {}
+```
+
 ### Create a custom ShippingEligibilityChecker
 ### Create a custom ShippingEligibilityChecker
 
 
 We want to ensure that the digital shipping method is only applicable to orders containing at least one digital product.
 We want to ensure that the digital shipping method is only applicable to orders containing at least one digital product.