Support

Home Forums Event Espresso Premium Adding additional items to the booking

Adding additional items to the booking

Posted: May 18, 2017 at 3:02 am

Viewing 17 reply threads


Bosworthsgc

May 18, 2017 at 3:02 am

Hi

We run a snowglobe at Christmas time

The basic booking is £10

But we also offer additional photos for £5

Once someone is within the booking process for this, is there a way I can add an additional item in for purchase?

Thanks


Tony

  • Support Staff

May 18, 2017 at 4:19 am

Hi there,

When you say ‘within the booking process’ do you mean they have already registered or whilst they are registering?

You can not add additional items to a registration once it has been made but if you want to allow the users to add the items during their registration you can use an additional ticket.

So you could have 2 ticket options:

Basic Booking – £10
Basic booking + additional photo – £15

Or you can set it up like:

Basic Booking – £10
Additional photo – £5

There is a limitation with this setup in that you can not require questions for additional registrants otherwise the ‘Additional Photo’ tickets will require at least the ‘Personal information’ question group.

Is that what you are looking for?


Bosworthsgc

May 18, 2017 at 4:29 am

Hi Tony

I was looking at it as you have suggested

BUT

for each day there are 19 half an hour slots

Each half hour slot can only have 5 groups

The five groups could be a mixture of basic booking or basic plus additional

I did just set up this example but it allowed 10 bookings per slot

Ideally what I am looking for is a question on the booking form that acts as a price modifier

So when the group check out the primary registrant is asked
” Do you want an additional usb key or photo” If the answer is yes it adds £5 on to the registration

I see that you have a plugin for this on EE3 – do you have anything even if in development that I could test on EE4 please

Thanks


Tony

  • Support Staff

May 18, 2017 at 4:51 am

We don’t currently have an add-on that is available for testing, but we do have a snippet:

https://github.com/eventespresso/ee-code-snippet-library/blob/master/checkout/bc_ee_apply_transaction_surcharge.php

That adds a surcharge based on the answer set on a specific question during registration. You’ll need to modify it to suit but it sounds like what you trying to do.


Bosworthsgc

May 18, 2017 at 4:54 am

Can you advise where I put the snippet?

I have a site specific plugin that I have for some other php code previously supplied for something else – would I put it in there?

Once its in there I assume I make a question that then relates only for this booking and nothing else?

Thanks


Tony

  • Support Staff

May 18, 2017 at 5:02 am

Yes you would place it within the custom functions plugin you already have.

Once its in there I assume I make a question that then relates only for this booking and nothing else?

No you’ll need to adjust the code for your specific use case, right now it looks for a specific question with ID 13, then check if the value is either ‘you print tickets at home’ (applies a £1.00 surcharge) or ‘we print and ship tickets’ (applies £2.50 surcharge) which doesn’t apply to your use case.

The snippet is an example/guide of how to set it up to apply the surcharge. If you are unsure we can set this up for you if you’d like to purchase a support token.


Bosworthsgc

May 18, 2017 at 6:26 am

Hi Tony

I have copied this over exactly and also set it up exactly as per the example in the code, just to try it so I can see what it does and then make alterations

However it doesnt work – the question is presented but no surcharge is added

Can you advise please

Thanks


Josh

  • Support Staff

May 18, 2017 at 6:56 am

Hi Jonathan,

You’ll need to make sure that the Question ID in your modified code matches the Question ID of the custom question you’ve set up.


Bosworthsgc

May 18, 2017 at 7:00 am

Hi

I did that

The question shows up but no surcharge is added


Tony

  • Support Staff

May 18, 2017 at 7:03 am

The code does work, I’ve just tested it to confirm.

Did you edit the code to match the ID of the question you created?

Currently, it looks for question ID 13: $surcharge_QST_ID = 13;

That add needs to be the ID of the question you created.

The surcharge will also only show up when you proceed through to the payment options.

Here is the test I did:

Reg form – http://take.ms/7X4rP

Next step – http://take.ms/V0bcM


Tony

  • Support Staff

May 18, 2017 at 7:07 am

It is also working on your site – http://take.ms/WO3ZJ


Bosworthsgc

May 18, 2017 at 7:15 am

Apologies – just cleared the cache – now I can see it


Bosworthsgc

May 18, 2017 at 7:57 am

Keep getting the follow error code now
Parse error: syntax error, unexpected ‘-‘, expecting ‘(‘ in /homepages/7/d588332988/htdocs/clickandbuilds/BosworthsGardenCentre/wp-content/plugins/Site-specific-plugin/bosworthsgc-customizations.php on line 116

This is as I am changing the values in my question then changing them in the code


Tony

  • Support Staff

May 18, 2017 at 8:00 am

There is an error in your code, you’ll need to re-step over the code on line 116 and compare it to the original to find the cause.


Bosworthsgc

May 18, 2017 at 8:53 am

Ah yes – found it thank you

I have one option of None set so that if no addons are required

I have used this code
/**
* EDIT THIS TO HOLD THE DETAILS FOR ONE OF YOUR ANSWER OPTIONS
* @return array
*/
function bc_ee_no_additional_addons_details() {
return array(
‘name’ => ‘No addons added’,
‘code’ => ‘None’,
‘description’ => ‘No charges added’,
‘unit_price’ => 0.00,
‘taxable’ => false,
);
}

But it just comes up with the word line and zero if none is selected – not sure what I am doing wrong on this bit

Can you advise please?

Thanks


Josh

  • Support Staff

May 18, 2017 at 9:14 am

Hi Jonathan,

The code you posted here, in and of itself will do nothing unless you’re calling the function. So you could check and make sure you’re calling the function when it’s a specific answer matching one of the switch cases.


Bosworthsgc

May 18, 2017 at 9:46 am

AS Tony posted earlier I may need to buy a support for this as its not functioning as I was hoping. Do I just purchase this through the main dashboard?

Thanks


Josh

  • Support Staff

May 18, 2017 at 10:09 am

You can order priority support here:

https://eventespresso.com/product/premium-support-token/

Viewing 17 reply threads

The support post ‘Adding additional items to the booking’ 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