Events Made Easy › Forums › Generic › #_DYNAMICPRICE triggers discount usage increment on form action recalculation
- This topic has 7 replies, 2 voices, and was last updated 6 years, 10 months ago by Franky.
-
AuthorPosts
-
Thu 21 Dec 2017 at 06:33 #57218AnonymousInactive
Expected behavior:
Discount code usage count is updated in DB only when an RSVP form is submitted.Actual behavior:
When #_DYNAMICPRICE is used in an RSVP form, discount code usage count is updated in DB on every form action user makes that involves #_DYNAMICPRICE recalculation.Why this is a problem:
A user may make a mistake and/or change their mind one or several times when selecting seats and/or entering discount codes in an RSVP form. If the form uses #_DYNAMICPRICE then every form action that triggers a recalculation of #_DYAMICPRICE (example: change in seat selection and/or discount code) immediately increments the specified discount code use count, even though the form has not been submitted. And, submitting the form increments the discount code use count again (as when #_DYNAMICPRICE is not used in the form).
So someone just changing their mind or correcting a mistake in number of seats chosen uses up discounts that should not be counted as used up.Fix:
The usage count for discounts should only be updated in the DB when the RSVP form is submitted – same as when #_DYNAMICPRICE is not used. #_DYNAMICPRICE recalc should not update discount use count in DB.Example/reproduce (there are countless possible use cases, this is one of the simplest):
I have 14 seats at 360.
I have set up fixed per seat discount of 50, max usage 5, code ‘firstfive’.
I select one seat in the RSVP form and #_DYNAMICPRICE shows me 360. No discounts are used up yet.
I enter ‘firstfive’ in the discount field. #_DYNAMICPRICE recalcs and shows me 310. One discount is used up from the 5 available.
The form has not been submitted yet but 1 of 5 discounts are already marked as used.
When I submit the form, another discount gets marked as used, same as if #_DYNAMICPRICE was not used in the form.
So 2 discounts have been incorrectly recorded as used up, should be only one.NOTE – there is a related bug, that the per-seat discounts used up do not match the number of seats chosen. Only one discount usage is counted, no matter how many seats I select. I pick 1 or 2 or 5 or 3 seats, only one per-seat discount is recorded used in the DB. I can write this up separately if you want.
Thu 21 Dec 2017 at 06:43 #57219AnonymousInactiveOK, I just saw in my plugins where I’m testing this to update from .11 to .15, and did that, looked in changelog which said you fixed some things with dynamic price calc. So I just regressed the above bug and the dynamic price calc issue is fixed. No extra discounts are used up when recalc is done.
However the related item I mentioned at end is still true. Number of per seat discounts used does not match number of seats booked.
I submit two seats (or 3 or more) with ‘firstfive’ discount but only one discount is used up. I am assuming “fixed per seat” means one discount should be used up for each seat – “per seat” – is that correct, or am I misunderstanding that discount?Thu 21 Dec 2017 at 08:18 #57220FrankyKeymasterFixed per seat means that a fixed amount is being deducted from the price per seat, but it still only uses 1 discount. The discount usage increases per discount code used.
Fri 22 Dec 2017 at 02:40 #57224AnonymousInactiveOK, thanks.
It seems contrary to the description of “per-seat discount.” If I book three seats at a per-seat discount, that should use up three discounts, whether in one booking or two bookings or three separate bookings. That is my use case anyhow:A fixed discount is given per seat booked, and, one discount is used up per seat booked.
for example there are five of 20 total seats available at a fixed discount, and each seat booked with that discount must reduce the available discounts by one.
Otherwise I cannot actually control that only five seats are available at that “per-seat” discount price. If someone books 2 in one booking I want only 3 left, but there will be 4 left.
Is there any way I have not tried yet that your plugin would do that?
If not would you consider this as a feature request?
It is a common use case in my experience. First X number of registrations (of some larger total registrations available) get a specific discount; after that one must pay the “regular” price.
I might even be able to contribute code – if the data/code model you have established so far can include this use case.thanks,
JohnFri 22 Dec 2017 at 20:32 #57225FrankyKeymasterDoing that would cause me to build a whole lot of extra logic into discounts, because: what to do if 4 places are already used, and a person reserves 2 more? Or more: what if several registrations are ongoing and those together surpass the limit? And more: what if those already saw the actual discounted price via #_DYNAMICPRICE and at the moment they press the button to actually book, they see that the price changed? Only one way then: to refuse the booking …
While I see your point, currently you’re the first one to ask for this. And I think that’s exactly why the program-type discount was created, so you can achieve what you want by coding that part yourself …
Or maybe: what if you just show the discount field as long as less than 5 places are reserved? You can use the conditional tag [eme_if] for that, see
http://www.e-dynamics.be/wordpress/category/documentation/7-placeholders/7-1-conditional-tags/Sun 7 Jan 2018 at 07:13 #57315AnonymousInactiveAway for holidays, checking back…thanks for response.
It would seem like you already need to be handling some of the cases you identify above, like 4 are used, someone tries to book 2 more…? A booking that was not available because someone booked seconds before the next person would have to be handled with an appropriate message.
Maybe you handle that for seats, but not for discounts, is that what you mean?Anyhow I understand this is not something you want to work on at this time.
I will do my best to find a workaround for my situation.The plugin I previously used was unfortunately abandoned – and, not as good as yours overall, just better for this type of discounting. It had a different model – seats were set up by quantity available and price, within an event, with total seats for the event a separate entry, and each booking deducted from the total seats for the event as well as the seats at that price. Discounts were integral with seats, not counted separately (there was also a “coupon code” option but I never used it).
In any case your plugin is well done overall and very versatile in terms of templates and fields and so on. I just happen to have a use case that doesn’t fit well.
regards,
John S.Sun 7 Jan 2018 at 09:20 #57316FrankyKeymasterWell, EME does already all that, except the discount availability count reduction per seat booked (the way you’d want it). I’ll take a look at that later on
Sun 7 Jan 2018 at 21:11 #57317FrankyKeymasterI just implemented this as a new feature:
https://plugins.trac.wordpress.org/changeset/1798615 -
AuthorPosts
- The forum ‘Generic’ is closed to new topics and replies.