Support

Home Forums Event Espresso Premium Adding currency symbol to total in Multi Event Registration cart

Adding currency symbol to total in Multi Event Registration cart

Posted: May 26, 2013 at 9:10 am


Nick Putman

May 26, 2013 at 9:10 am

Hi

For some reason the currency symbol for my events is not showing next to the total amount when using the Multi Event Registration plugin.  How do I enable this?

Thanks,

Nick


Dean

May 27, 2013 at 1:27 am

Hey Nick,

 

Good eye! Didnt spot that. Looks like an error in the code, as it should be displaying it but for some reason the way its written is causing it nt to be displayed.

If you edit the shopping_cart.php file in the templates folder, on line 133 you will see

<?php _e( ‘Total ‘, ‘event_espresso’ ) . $org_options[‘currency_symbol’];?> <span id=”event_total_price”><?php echo $_SESSION[‘espresso_session’][‘grand_total’];?></span>

 

change it to

<?php _e( ‘Total ‘, ‘event_espresso’ ) ?> <?php echo $org_options[‘currency_symbol’];?><span id=”event_total_price”><?php echo $_SESSION[‘espresso_session’][‘grand_total’];?></span>

All this does is break the text and symbol into separate code blocks and removes a space, you will end up with this http://d.pr/i/gC0Q

I’ll get a ticket raised to look into fixing it.

 


Nick Putman

May 27, 2013 at 3:21 am

Thanks, Dean.  That adds the currency symbol, but loses the ‘0.00’ on initial page load.  It appears if I click ‘Refresh Total’, but not on page load.  Would it be possible to include this too?

Nick


Dean

May 27, 2013 at 3:36 am

Thats strange it didnt do that in my test server, what version of EE are you running?

Also, try clearing your cache.


Nick Putman

May 27, 2013 at 3:38 am

Version 3.1.32.2.P

And yes I’ve cleared the cache – it’s definitely the new code that is being included.


Nick Putman

May 27, 2013 at 3:42 am

You can see what I mean by visiting this page and clicking on the ‘Register for this event’ link:

http://opendialogueapproach.co.uk/?page_id=585


Dean

May 27, 2013 at 4:06 am

Same version as me, but yes I see its not doing it. The code is obviously included, but whereas on my test server the price is instantly refreshed on page load, yours doesnt seem to be doing that.

On further testing the default action is for the Total to display as: Total. Just the word, no currency symbol( because it wasnt working) and no amounts. So the display of Total £ is correct.

Now what I must have done with my testing server is add something in to force a refresh, as it doesnt do that on other testing servers (the joy of constantly hacking at code!).

What it turned out to be was Volume Discounts – it has some code in the plugins javascript files that refreshes the price.

So the answer is to add a small jQuery script that fires EECART.calculate_total() on page load to force the value to refresh.


Nick Putman

May 27, 2013 at 4:23 am

Thanks Dean.  How do I add the script? to fire EECART.calculate_total() on page load?

Nick


Dean

May 27, 2013 at 4:52 am

Hmm well I just hacked the core JS but that isnt advisable lol.

Well Im sorry this is a little out of my league as im no jQuery expert, it looks like that function cant be called in a script in the page template either, so the only way would be to examine the jQuery and create something custom.

Looking at the code as best I can it looks quite complicated to make this happen, with functions pulling data from a  variety of sources.

So Im not quite sure how to advise further than that, sorry.


Nick Putman

May 27, 2013 at 6:05 am

OK, no problem.  I will use the Volume Discount plugin for now, but if you could add this to the list of requested features that would be good.

Thanks,

Nick


Dean

May 27, 2013 at 6:09 am

Sorry about that. Yeah I have raised a ticket to get it fixed as it should in my mind show, ill mention the refresh issue as well.

The support post ‘Adding currency symbol to total in Multi Event Registration cart’ 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