1

I'm working on a checkout process for a takeaway restaurant where anonymous visitors can place orders using guest entries.

In this stage the order is saved with a status of "unpaid". Once a visitor saves the order he's taken to a payment provider service where he pays for his order, once the order is payed the visitor is redirected to a page where the order status would be set to "paid" in a hidden form.

In order to accomplish this the aforementioned saved guest entry would have to be edited from the front-end. Is it possible to anonymously edit an entry?

  • 1
    You may need to provide us with more details. i.e. Does the guest user submit a form? What action should trigger the update? What specifically are you trying to update? etc. – Douglas McDonald Dec 8 '14 at 21:28
2

You should be able to edit that entry using craft()->entries->saveEntry($entry) with $entry->authorId set to a registered user with the necessary permissions. To get the ID of the user that created the entry, access the Guest Entries plugin settings in your plugin:

$settings = craft()->plugins->getPlugin('guestentries')->getSettings();
$authorId = $settings->defaultAuthors[$entry->section->handle];
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.