Posted: November 27, 2013 at 4:48 pm
|
is there a simple way to do this? I have tried adding what should be there instead of $num_attendees to get it working? Any help gratefully received! i also tried things like: Unfortunately my knowledge has big gaps and I am mainly guessing. I’m also looking to do the same with event price and tax, I can already pass total amount, description etc fine. |
Hi Tristan, Do you need to display this within gateway_display.php? If so why? Reason I ask is that file is a core file, any changes made there will be lost after each update. You can use quantity without modifying that page. Unfortunately custom payment gateways are beyond the scope of general support but I can give you some advice. If you look through some of the other gateways, you’ll see: $quantity = isset($quantity) && $quantity > 0 ? $quantity : espresso_count_attendees_for_registration($attendee_id); Which pulls in the quantity for that registration. If you look in gateways/authnet/authnet_vars.php line 48 you’ll see another method for pulling in the information: $sql = "SELECT a.final_price, a.quantity, ed.event_name, a.price_option, a.fname, a.lname FROM " . EVENTS_ATTENDEE_TABLE . " a JOIN " . EVENTS_DETAIL_TABLE . " ed ON a.event_id=ed.id "; As part of the SQL query, quantity is being retrieved from the database then used further down within the foreach loop $item->quantity. Custom Gateways were intended for developers to add ‘unsupported’ (from an EventEspresso point of view) gateways for their clients. Are you copying another gateway and modifying it to suit?
|
|
|
Hi, Thanks, adding Any idea how to carry across the event cost [cost for a single ticket] and tax.. although now I have quantity working I could just use some math to work out event cost and tax, but would rather call the variables if they are available. It is for the Sagepay gateway Thanks again for your help, much appreciated! |
|
actually i don’t need to send the tax amount anyway, and i have easily got the ticket cost by doing amount / quantity. I do need the start date however – I have this at the moment by adding slightly off topic, but can i copy gateway_display.php to a /templates folder which will get read if exists and not get written over on updates? |
I’ve just checked into this and it turns out that yes you can copy the gateway_display.php file to wp-content/uploads/espresso/gateways/ Copy the file there and modify the new version there. That will keep it safe from updates. (from time to time you may find we add sections to these files which you will need to match in your modified versions) That way you should be able to use the method above for start_date. Just to clarify, that file is used by all gateways, adding what you have mentioned should not cause any issues, however it is untested and unfortunately unsupported by ourselves. There is nothing wrong with what your trying to do just that if you find issues further down the line, whilst we will usually help as best we can you may find you also need the help of a developer. |
|
|
Thanks for your help. Maybe defining the start date in gateway_display.php could be added in future updates as its quite important to be able to confirm the date of the event in emails and payment confirmations when there are multiple dates for the same event. |
No Problem, thank you for your feedback. I would need to double check this, but iirc information used within gateway_display.php (and the gateways) is used almost exclusively for the gateways only. The emails are built using the registration information from within the Database and you can use the [start_date] shortcode within the payment confirmation email to retrieve the start date for that attendee. The gateways ‘trigger’ the building of said emails on successful payment notification, but other than that are not involved afaik. I may well be wrong and will double check this, but due to the holidays it may be a little before I can provide a definitive answer. |
|
The support post ‘How do I send number of attendees / ticket quantity, to custom payment gateway’ 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.