Hi,
Is it possible to edit product comments in frontend. I cannot fins any documentation about it.
Tried with "Edit" and "Update" in "Commad.Command" field.
Regards / Aki
Hi,
Is it possible to edit product comments in frontend. I cannot fins any documentation about it.
Tried with "Edit" and "Update" in "Commad.Command" field.
Regards / Aki
You cannot - it has 3 commands:
2+3 requires that you send ?Comment.ID={commentId}&Comment.Token={Token}
What you can do is 'cheating' and create an edit form for a comment and then when submitted, send 2 requests (using JS) - one for deleting the old comment and one for creating the new one. This works - and triggers approval workflow to run again if that is setup. Only thing here is that the timestamp will change if not handled in Notifications.Commenting.OnBeforeComment notification subscriber.
Another approach would be to send the 'create' command with an additional hidden field (I.e. "Edit.Comment.ID") that includes the comment being edited. Then again using the Notifications.Commenting.OnBeforeComment subscriber, find the comment being edited from the "Edit.Comment.ID" field, get its date, update the date on the new comment (passed to the notification arguments) and then delete the comment found with the "Edit.Comment.ID"
Of course ensure to take security into consideration.
BR Nicolai
Thanks for the suggestions. Went with the subscriber approach.
Regards / Aki
You must be logged in to post in the forum