Back to Website
Show / Hide Table of Contents

Output data

  • Last updated on February 20, 2025
  • •
  • Less than a minute to read

When the user finishes editing the product, the Handy Editor triggers the addtocart event. To process the result, handle this event as follows:

handyEditor.addEventListener("addtocart", event => {
    const cartItem = event.detail;
    console.log(cartItem);
});

As a result, the following object will be returned:

{
  key: string; //  the key of this lineItem, the same as `stateId`
  quantity: number; // quantity of items in the order
  originalProductId?: string; // product ID before editing
  sku?: string; // a product SKU 
  properties: {
    _stateId: string[]; // an array of state files generated by the customer
    _userId: string; // a customer ID
    _hidden: {
      images: string[]; // an array of URL previews
    };
  };
}

Based on this data, you can create a project with the endpoint Projects_CreateWithSingleItem. For more details on working with projects, refer to Processing personalization results.

Was this page helpful?
Thanks for your feedback!
Back to top Copyright © 2001–2025 Aurigma, Inc. All rights reserved.
Loading...
    Thank for your vote
    Your opinion is important to us. To provide details, send feedback.
    Send feedback