Support

Home Forums Multiple Event Registration Add-on Overriding Add-on files

Overriding Add-on files

Posted: October 31, 2016 at 7:55 am


George

October 31, 2016 at 7:55 am

Hi there,

Please i need help overriding this file “EE_Mini_Cart_List_Line_Item_Display_Strategy.php” within the Multi Event Registration Add-on. Is this possible, and if so, please how can i override it? Include the file within wp-content or what? please help…


Tony

  • Support Staff

October 31, 2016 at 7:59 am

Hi there,

Currently its not possible to override core files by placing a copy within /wp-content/, that works for almost all of our template files, but not other core files.

Can I ask what it is your looking to change? I’ll check in with our developers to see if its possible.


George

October 31, 2016 at 8:09 am

Hi Tony,

Thanks for your swift response.

I’m looking at changing/removing some information that appear on the list <ul> ... </ul> section and also add some css classes so it can conform to my theme. I’m hoping this will be possible instead of directly overriding the files.


Tony

  • Support Staff

October 31, 2016 at 8:22 am

Can you be more specific?

What are you looking to edit within the ul?

also add some css classes so it can conform to my theme

Can you not just add the same style to the classes used by EE with some custom CSS?

Completely overriding a display strategy seems excessive for the above. The other option I can think of is the build your own display strategy and use it within the mini cart template file (which is override-able within wp-content) but I will see if our developers can provide any feedback. (Will take a little due to time differences)


George

October 31, 2016 at 9:16 am

I want completely change/update the style & structure of the mini_cart_widget using the “widget_minicart_list” as base. Below link is an example of how the widget will look like when im done: http://www.kizomba.ng/support/plugins_support/event_espresso/multi_event_reg/sample_final_outcome.png

In order for me to archive this, I need to update the following files within the Multi Event Registration Plugin Folder:

1. widget_minicart_dropdown.template.php
Within this file, I will be making lots of changes like removing excess information like:
i. Replacing the widget title with an icon with item count (see image above or attached)
ii. Modifying the event item title display
iii. Modify item amount display
iv. Remove TAX/surcharge or any other additional cost calculation information
v. Modifying the total amount display
vi. Modify “view event cart” & “Proceed to registration” buttons
2. EE_Mini_Cart_List_Line_Item_Display_Strategy
a. Within this file, I will be adding custom css classes to some

  • components like the item rows
    b. I will also modify the html tags of certain modules like the tax rows and adding custom css classes to it

    My general knowledge of Event Espresso (coding) is not that great, so is my wordpress skills but atleast I can try.
    It would be great if I can override these files and any other files that may be affected instead of hard-coding my changes there or perhaps are there filters that can do this, I don’t know, I’m just making educated guesses/assumptions.

    Thanks.


  • Josh

    • Support Staff

    October 31, 2016 at 6:22 pm

    I checked into this and widget_minicart_dropdown.template.php isn’t a real file, maybe you meant widget_minicart_table.template.php?

    If so, you can copy that file to your WordPress theme, and use a filter hook to allow selecting your new template. Here’s the example code you add to a functions file:

    add_filter('FHEE__EEW_Mini_Cart__form__minicart_templates', 'my_custom_mer_mini_cart_template', 10, 1 );
    function my_custom_mer_mini_cart_template( $minicart_templates ) {
    	$newtemplate = get_stylesheet_directory() . '/my_new_template.template.php';
    	array_push( $minicart_templates, $newtemplate );
    	return $minicart_templates;
    }

    Once your copied file is in your theme, and the above filter function is active, you’ll be able to go into the widget settings in Appearance > Widgets and change the Mini Cart Template dropdown to the one you just edited (it will show the filename you gave it).

    With the other file, there shouldn’t be any need to add CSS classes. Can you not target the elements using existing CSS classes or even target them without CSS classes?


    George

    November 1, 2016 at 2:39 am

    Hello Josh,

    Thank you for your support & snippet code above.

    Yes, you’re right, there’s no such file as widget_minicart_dropdown.template.php; I meant widget_minicart_list.template.php. My intention is to create widget_minicart_dropdown.template.php which I will do and add it using the code you sent in your reply.

    With the other file, there shouldn’t be any need to add CSS classes. Can you not target the elements using existing CSS classes or even target them without CSS classes?

    I need to modify EE_Mini_Cart_List_Line_Item_Display_Strategy.php as I need to change its html structure. For example: there are elements that I will change from

  • to <div> or <span> or vice versa. Also, these custom classes are already made and exist within my WordPress theme.
    I also want to remove certiain element within as well like tax details, etc.

    Am thinking, is there a way I can override EE_Mini_Cart_List_Line_Item_Display_Strategy.php using filters just like widget_minicart_dropdown.template.php

    Thanks


  • Josh

    • Support Staff

    November 1, 2016 at 6:47 am

    No you cannot override the Display Strategy file. My advise is you can use CSS to make the modifications.


    George

    November 1, 2016 at 7:39 am

    Hi Josh,

    Can i just create my own Display Strategy? Is yes, how do i go about it…can you give me a sample file and maybe a code on how to activate it within my theme?

    Thanks


    Josh

    • Support Staff

    November 2, 2016 at 5:35 pm

    George that’s an awful lot of code to maintain just to add some CSS classes. A better way forward would be to add some filter hooks to allow for adding said CSS classes. Do you have a Github account?


    George

    November 4, 2016 at 9:10 am

    Hi Josh,

    No, i dont have a Github account yet.

    I will take your advise using filter hooks.

    Regards.

    The support post ‘Overriding Add-on files’ 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