Support

Home Forums Event Espresso Premium Change Date & Time format on Shopping Cart Template

Change Date & Time format on Shopping Cart Template

Posted: July 2, 2013 at 11:36 am


Frank Gribbin

July 2, 2013 at 11:36 am

Hi,

1 – I have been trying to change the date and time format on the shopping cart page.

I have used the shortcodes provided in the documentation but they do not seem to work on this page (shopping_cart.php) and have had no luck finding any similar posts in the forum.

I am using WordPress v3.5.1 along with Event Espressio v3.1.33.3.P and have the Multi User Registration plugin installed v1.0.4

2 – As well as change the date format I would like to only display the start time as well but I can’t seem to find a way to do this as the usual shortcodes which I have working on other template pages are just not working on this page.

When I remove the end time from an event in the Admin area it still leaves the word ‘to’ after the start time.

3 – On the shopping cart page with the Multi User plugin, it states the maximum number of tickets/attendees that can purchase/register. I an looking to change the wording of this text but have been unable to find the file this is in to change it. Any ideas?

4 – Also, I can’t find the file that contains the Ticket Type, Ticket Price and Quantity dropdown that is displayed on the shopping cart page, it seems to be called from this line <?php do_action_ref_array( ‘action_hook_espresso_add_to_multi_reg_cart_block’, array( $r ) ); ?> but so far have been unable to locate the code in any of the template files.

Thanks for your time and effort looking in to the above for me.

Regards,

FRANK


Sidney Harrell

July 2, 2013 at 5:21 pm

1. In shopping_cart.php it uses the date format set in your WordPress settings (line 70):

<?php echo event_date_display( $r->start_date, get_option( 'date_format' ) ) ?>

you can override this by putting a different format instead of the get_option( ‘date_format’ )
2. This is being caused by some code in includes/functions/time_date.php (line 205):

foreach ($event_times as $time) {
                $html .= '<span class="span_event_time_value">' . event_date_display($time->start_time, get_option('time_format')) . '</span>';
                $html .= $label == 1 ? '<br/><span class="span_event_time_label">' . __('End Time: ', 'event_espresso') . '</span>' : __(' to ', 'event_espresso');
                $html .= '<span class="span_event_time_value">' . event_date_display($time->end_time, get_option('time_format')) . '</span>';
                $html .= '<input type="hidden" name="start_time_id' . $multi_name_adjust . '" id="start_time_id_' . $time->id . '" value="' . $time->id . '" />';
            }

you can change the default behavior by changing it to:

foreach ($event_times as $time) {
                $html .= '<span class="span_event_time_value">' . event_date_display($time->start_time, get_option('time_format')) . '</span>';
          if(!empty($time->end_time)) {      
                $html .= $label == 1 ? '<br/><span class="span_event_time_label">' . __('End Time: ', 'event_espresso') . '</span>' : __(' to ', 'event_espresso');
                $html .= '<span class="span_event_time_value">' . event_date_display($time->end_time, get_option('time_format')) . '</span>';
           }
                $html .= '<input type="hidden" name="start_time_id' . $multi_name_adjust . '" id="start_time_id_' . $time->id . '" value="' . $time->id . '" />';
            }

3. This is actually in includes/functions/cart.php (line 1194):

<?php printf(__("You can register a maximum of %d attendees for this event.", 'event_espresso'), $attendee_limit); ?>

but it is a translatable string, so you can change it with a po file.
4. It’s actually right above that:

event_espresso_time_dropdown

and

event_espresso_group_price_dropdown

The support post ‘Change Date & Time format on Shopping Cart Template’ 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