Developer forum

Forum » Development » Notification before added to cart

Notification before added to cart

Kurt Moskjær Andersen
Kurt Moskjær Andersen
Reply

Hi,

Our customer would like to be able to upload an image from the product page, just before it is added to the cart.

I've added a custom orderline field and rendered a file-input field instead of the normal text-input, on the frontend.

Is there a way to get a notification before the product is added to the cart, in order for me to handle the upload myself? I've looked at the notification Dynamicweb.Ecommerce.Notifications.Ecommerce.Cart.Line.Added, but I cannot get the binary content of the file-field from here.

Should I make my own "middle-man script", to save the uploaded file and then add the product to the cart, or is there a smarter way?

--
Best regards
Kurt Moskjaer Andersen


Replies

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply
This post has been marked as an answer

>> I cannot get the binary content of the file-field from here.

Doesn't HttpContext.Current.Request.Files give you access to the uploaded files?

Imar

Votes for this answer: 1
 
Kurt Moskjær Andersen
Kurt Moskjær Andersen
Reply

Hi Imar,

Sorry, for my late reply - yes, it gives me access to the files.

/Kurt

 

You must be logged in to post in the forum