Support

Home Forums Event Espresso Premium archived ticket price modifiers deleted when saving event

archived ticket price modifiers deleted when saving event

Posted: June 28, 2019 at 8:05 am

Viewing 15 reply threads


sara.bosman

June 28, 2019 at 8:05 am

When I save an event, all price modifiers of archived tickets are removed. All generated invoices also set to zero; especially this is a big problem. Any help?

Some screenshots:

screenshot before save

screenshot after save


sara.bosman

June 28, 2019 at 8:06 am

(the first screenshot is before saving, the second after)


Josh

  • Support Staff

June 28, 2019 at 8:32 am

Hi,

May I ask can you update the site to the current version of Event Espresso 4? The reason I ask is because this issue cannot be replicated when testing the current version.

I can look into this further, but in the meantime I can advise to update to the current version of the software.


sara.bosman

June 28, 2019 at 9:50 am

I just did the update to the latest version, saved another event, ticket modifiers of archived ticket disappeared again (also from the database as far as I can see)


Josh

  • Support Staff

June 28, 2019 at 10:10 am

May I ask are there any code customizations (via add-ons or otherwise) in place? Normally we’d be able to replicate the same issue, but have not so far with the current version of EE4.

You might also try clearing your browser’s cache since the older JavaScript files from the older version could still be loading.


sara.bosman

June 28, 2019 at 11:48 am

Ok, I ran the following test:
– created an event with a ticket with price X
– registered for the event
– disabled all plugins except AFCF, AFC pro, EE4 + mailchimp & people addons (all the latest versions)
– disabled any admin javascripts, EE or WP customisations/custom post types…
– opened the event edit page; checked that the price was still X
– changed the price to Y, and again, all price modifiers were gone, even from the database

I’ll run a few more tests tomorrow.


sara.bosman

June 28, 2019 at 11:49 am

(edit: the price modifiers are gone after saving the event)


Josh

  • Support Staff

June 28, 2019 at 1:06 pm

I should clarify a bit about the Price Modifiers and what happens when their attached ticket is archived: They should get moved to the new ticket (they do not stay with the archived ticket).

The part that I wonder about is how the invoices are set to zero. Do you mean that the line item values are getting set to zero, or something else? Normally when a ticket is archived it has no effect on invoices because the invoices do not pull values from the esp_ticket and esp_price tables. Instead, they pull values from esp_line_item.

Can you add some clarification about the changes you’re seeing with the invoices after archiving a ticket?


sara.bosman

June 29, 2019 at 4:59 am

Currently our invoices pull their values form esp_price, not from esp_line_item. The problem with the latter is that I need to know the price type where the line came from. The reason is rather technical: tickets are only partly eligible for susbsidy by the government, and this depends on the price type. Food, drinks, overnight stays and taxes can not be subsidized, while the rest can. But esp_line_item only gives me the name (which varies each event), not the type, and there is no link between price type and ticket item.

So my questions:
– why would you want to move price modifiers instead of copy them? price modifiers are an essential part of how ticket prices are calculated, and you lose that information by clearing them when archiving
– any ideas to solve my problem? how can I know which price modifiers have been used?


sara.bosman

June 29, 2019 at 5:58 am

And a third question:
– If I change a ticket price and save the event, the price modifiers are initially copied (see first screenshot). It is only when saving the event a second time (e.g. months later, when changing something small in the description of the event) that the modifiers of the archived version are removed (also from the database) – why is that?

The only workaround I can think of right now is, when building the invoice for the archived ticket, to compare the name of the line item with the price modifiers of the newer ticket, and try to figure out the price type that way, but that is a long (and error prone) shot.


Josh

  • Support Staff

July 1, 2019 at 1:06 pm

why would you want to move price modifiers instead of copy them? price modifiers are an essential part of how ticket prices are calculated, and you lose that information by clearing them when archiving

Because once the transaction is created, that’s what line items are for, price modifiers are for anything before the transaction. Archived tickets are no longer available for new transactions.

If I change a ticket price and save the event, the price modifiers are initially copied (see first screenshot). It is only when saving the event a second time (e.g. months later, when changing something small in the description of the event) that the modifiers of the archived version are removed (also from the database) – why is that?

Because the changes to the event have not been updated/saved until you hit the Update button.

any ideas to solve my problem? how can I know which price modifiers have been used?

You can use the line items for the transaction to know exactly which price modifiers were used. This is what they’re recorded for. You can continue to get the price type from the other table, but the amounts & names of the price modifiers can be taken from the esp_line_item table.


sara.bosman

July 1, 2019 at 3:55 pm

With all respect, but I’m not sure if you are actually listening.

Of course I know I have to hit the Update button to save an event. But after the first update, the price modifiers are initially copied. I can close the page, return months later: the price modifiers of the archived ticket are still there. Only when I hit the Update button a second time (even without making any actual changes), the price modifiers magically disappear.

As for whether modifiers of archived tickets should disappear: they should not, period. That has nothing to do with availability: a ticket can keep its modifiers and still be set unavailable. It is just essential information of how the pricing of the archived ticket was set, even after it is archived.

But I finally found a solution: the (obscurely named) field OBJ_ID in wp_esp_line_item tuns out to point to wp_esp_price, which has the desired link to wp_esp_price_type. I was confused because the link between line item and price is missing on your venn diagram; you might want to update it.

Thanks for your patience anyway.


Josh

  • Support Staff

July 1, 2019 at 7:33 pm

OBJ_ID is also known as Object ID, and the next column OBJ_type provides the type of object.


sara.bosman

July 3, 2019 at 6:05 am

I know, but the point is: the price object it refers to is removed from the database.

Please bear with me. I eat my shoe if it is not a bug. Here’s how you can replicate it in 2 minutes:

  1. download and install a fresh WordPress site
  2. install the Event Espresso 4 Core Regular v4.9.82.p plugin, nothing else
  3. create a new event; create a ticket with base price of $100 and add a dollar surcharge price modifier of $50 (total of $150 per ticket)
  4. go to the event and register an attendee
  5. edit the event: change the modifier from $50 to $70; click Update
  6. the old ticket will be archived (purple color); inspect its details: the old price modifier of $50 is still in place
  7. check the database: TXN_ID will be 1; in table esp_line_item you will find the $50 modifier in LIN_ID 6 pointing to OBJ_ID 4; in esp_price you will effectively find a price of $50 with PRC_ID 4
  8. go to the event: click Update again; inspect the archived ticket and BAM! – the price modifier is gone. Recheck the database: the price with PRC_ID 4 is gone. But in esp_line_item on LIN_ID 6, there is still a reference to OBJ_ID 4

See?


Josh

  • Support Staff

July 3, 2019 at 6:19 am

The esp_line_item table still has the price related information for line item 6 though, correct? For example the amount is LIN_total and the name is LIN_name.

Another approach you could take since you rely on price data and not line items is you could not change prices, and instead add a new ticket to replace the old ticket price. So instead of automatically archiving, you’ll keep that ticket and change its sale date to end at that moment. The archived tickets were not intended to be used for transactional data, so you’ll avoid that limitation by avoiding archived tickets.


sara.bosman

July 3, 2019 at 4:00 pm

That gives me the amount only, but not the price type, which is – as I tried to explain – essential to know which part of the ticket price is eligible for subsidy, and which is not.

Note: after the second update, the TKT_Price field in esp_ticket also shows wrong prices of the archived tickets (i.e. the base price, without modifiers). This can never be intentional.

I already figured out the second approach for new tickets, but for existing archived tickets, I used the workaround I mentioned earlier (comparing the line item names of the archived ticket with the new ticket). That works, but it is ugly and hacky.

The only good fix is what I’ve been saying all along: do _not_ remove the modifiers for archived tickets. There isn’t a single reason to do so. It is a bug, nothing more, nothing less.

Viewing 15 reply threads

The support post ‘archived ticket price modifiers deleted when saving event’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso