Posted: September 7, 2017 at 10:19 am
|
Which action or filter hook would I use to change the price on the 3rd page (Payment Options) when registering for an event. I see a lot of actions on this page, just not sure which one? Or perhaps a filter? Ideally, I have a special email that I want to put on the hook (will never change). And if the user had used this special email the price would change, hence using the hook to change the price on the 3rd page. |
The |
|
|
Thanks, Josh. Is there a link to documentation for this hook? I see tons of protected objects and arrays which I would presume are all different types of methods… |
|
I realized that I could inject the EE_SPCO_Reg_Step_Payment_Options object into the parameters and receive all the chain methods with an IDE. If a link is available! I wouldn’t mind it thought :] |
Hi Lola Communication, I’m curious to know what documentation for a hook would look like? Maybe this example code that shows a way to use the hook will help: |
|
|
I just realized that this hook only allows changing after step 3 is submitted/processed. However, I am looking for after step 2 is submitted/processed and on step 3 I would be allowed to change the pricing. This would have the changed pricing shown in step 3 rather than after step 3 is submitted/processed. A bit funky, but I hope that’s not confusing.. Testing other hooks as I see them in order, but so far no luck! |
You could try this one instead:
|
|
|
This is the correct hook, thank you! However, I’m still trying to figure out how to change pricing and specific transaction information on the submission. I’ve tried so far:
$data->checkout->transaction->items_purchased()[$first_key]->set('LIN_unit_price', 10); $data->checkout->transaction->set('LIN_unit_price', 10); $data->checkout->cart->get_grand_total()->set('LIN_unit_price', 10); $data->update_checkout(); // actually cause false return error None of the above methods seem to work. This is the lack of docs part 😉 |
|
Sorry for the ugly format. Use this below link for better preview: |
You actually have one too many brackets on this line:
I can suggest starting a github issue here: https://github.com/eventespresso/event-espresso-core/issues and one of the developers can follow up with any further questions you may have. |
|
|
That was just a typo, sorry. So, out of curiosity which method should have updated the pricing then? |
I can advise that you start a github issue here: |
|
|
September 11, 2017 at 10:10 am Okay, just made one! I don’t believe it’s a bug though. Just a matter of understanding all the available methods and object cases. |
September 11, 2017 at 10:14 am I went ahead and labeled your issue report as a “question”. |
|
The support post ‘Changing Price from Action/Filter Hook’ 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.