Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create a new event targeting properties in Umbraco #10

Open
JamiePattison opened this issue Apr 30, 2024 · 1 comment
Open

How to create a new event targeting properties in Umbraco #10

JamiePattison opened this issue Apr 30, 2024 · 1 comment

Comments

@JamiePattison
Copy link

I have added a new property to my Item/Product Document Type which contains other Commerce properties such as SKU.

I need to validate the value it contains before adding the product to the cart.

  1. I noticed there is an event for this (ValidateOrderProductAdd) which had been demoed to check the stock value but should I be adding a new Event for my needs? If yes how do I go about this?

  2. If I can use the existing validation, that's fine but again how do I access the newly created property as I can't see it listed under evt?

Or simply put should I do this in the controller when adding the product?

@mattbrailsford
Copy link
Contributor

Hi Jamie, there is a guide here for adding your own validation handlers https://docs.umbraco.com/umbraco-commerce/how-to-guides/limit-orderline-quantity

To access the property, you'd probably need to use the product reference of the order line to lookup the product node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants