Search

Hello,
I have a save-order event where a Members user creates an item. The result is this code:

<save-order result="success" type="created" id="38">

The order has a Hash_id field attached, whose value is created at insert time. I need to publish on the page that hash, but I cannot find it in the save-order event.
I tried to create a DS filtering the System ID by /data/events/save-order/@id to no avail.
I would not like to put the System ID in the Url, any suggestion?

Thanks

I would not like to put the System ID in the Url, any suggestion?

I understand you concern, but right now you have 2 options and one will require this...

  1. Redirect to a url with the id in it. On that page, create a custom event that will look into the database to find the hash and issue a redirect() call.
  2. Or, in your current event.php file, add a line like this one

Frontend::Page()->_param['my-hash'] = 'hash value from SQL query';

Make sure to not edit the file with the Event editor from now on. Removing those line would help

What about using SymQL query in your event.php file after the results are returned from the event trigger to grab the hash value based on the ID that is returned..?? a chained event sort of idea?

We do this quite regularly with Event registration forms that require hash Id's in the URL which resolve to the actual order ID as well.

Good solution too @moonoo2

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details