Answers.Body: <p>Yes using the onPopulateLineItem event. Something like this should work:</p>
  
  <pre><code>craft()-&gt;on('commerce_lineItems.onPopulateLineItem', function($event){
  
      $purchasable = $event-&gt;params['purchasable'];
      $lineItem = $event-&gt;params['lineItem'];
  
      $lineItem-&gt;options = array_merge(
        $lineItem-&gt;options,
        ['customFieldLabel'=&gt;$purchasable-&gt;customField]
      );
  
  });
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-25T21:31:38.997Z
Answers.LastActivityDate: 2017-04-25T21:31:38.997Z
Answers.UserDisplayName: Luke Holder
Answers.Body: <p>For Craft 3 Nathaniel from Pixel &amp; Tonic helped us with the below:</p>
  <p>In the following example, I am adding the titles of a category relationship field productColours to the snapshot but only for the products in the product type of clothing.</p>
  <pre><code>// Modify product snapshot
  Event::on(Variant::class, Variant::EVENT_AFTER_CAPTURE_PRODUCT_SNAPSHOT, function(CustomizeProductSnapshotDataEvent $event) {
      $variant = $event-&gt;sender;
      if (!$variant instanceof Variant) {
          return;
      }
  
      $product = $variant-&gt;getProduct();
      if (!$product || $product-&gt;type-&gt;handle != 'clothing') {
          return;
      }
  
      $colours = $product-&gt;productColours-&gt;all();
      if (empty($colours)) {
          return;
      }
  
      $event-&gt;fieldData['productColours'] = ArrayHelper::getColumn($colours, 'title');
  });
  </code></pre>
  <p>You will also need to add</p>
  <pre><code>use craft\commerce\events\CustomizeProductSnapshotDataEvent;
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-01-06T12:36:42.333Z
Answers.LastActivityDate: 2021-01-06T12:36:42.333Z
Answers.UserDisplayName: Green17
Body: <p>How would I add more information (custom fields) to a variant's snapshot?</p>
  
  <p>The custom field I'm adding will change over time, but I need it to stay consistent on invoices etc. </p>
  
Tags: <plugin-craftcommerce>
Title: Add custom fields to variant snapshot
ThreadText: # Add custom fields to variant snapshot
  
  (Asked by: username_0 on 2017-04-25)
  
  How would I add more information (custom fields) to a variant's snapshot?
  
  The custom field I'm adding username_0 change over time, but I need it to stay consistent on invoices etc.
  
  **Tags:** plugin-craftcommerce
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2017-04-25. Score: 5 | Accepted answer
  
  Yes using the onPopulateLineItem event. Something like this should work:
  
  ```
  craft()->on('commerce_lineItems.onPopulateLineItem', function($event){
  
      $purchasable = $event->params['purchasable'];
      $lineItem = $event->params['lineItem'];
  
      $lineItem->options = array_merge(
        $lineItem->options,
        ['customFieldLabel'=>$purchasable->customField]
      );
  
  });
  
  ```
  
  
  ---
  
  ### Answer by username_2 on 2021-01-06. Score: 2
  
  For Craft 3 Nathaniel from Pixel & Tonic helped us with the below:
  
  In the following example, I am adding the titles of a category relationship field productColours to the snapshot but only for the products in the product type of clothing.
  
  ```
  // Modify product snapshot
  Event::on(Variant::class, Variant::EVENT_AFTER_CAPTURE_PRODUCT_SNAPSHOT, function(CustomizeProductSnapshotDataEvent $event) {
      $variant = $event->sender;
      if (!$variant instanceof Variant) {
          return;
      }
  
      $product = $variant->getProduct();
      if (!$product || $product->type->handle != 'clothing') {
          return;
      }
  
      $colours = $product->productColours->all();
      if (empty($colours)) {
          return;
      }
  
      $event->fieldData['productColours'] = ArrayHelper::getColumn($colours, 'title');
  });
  
  ```
  
  You username_0 also need to add
  
  ```
  use craft\commerce\events\CustomizeProductSnapshotDataEvent;
  
  ```
  
  
  ---
  
  