Support

Home Forums Event Espresso Premium Display Event Cart only when not empty? (redux)

Display Event Cart only when not empty? (redux)

Posted: August 10, 2016 at 8:28 pm


nyingma

August 10, 2016 at 8:28 pm

I have tried the code from a previous post of the same title here and I can not get the new template to show up in the select box on the widget admin. I have tried everything short of trying in a different theme (I am a using Divi child theme). If I am interpreting wp-content/plugins/eea-multi-event-registration/EEW_Mini_Cart.widget.php correctly it is only looking for templates in the templates directory in the eea-multi-event-registration plugin directory…or am I missing something?


Josh

  • Support Staff

August 11, 2016 at 12:39 pm

It looks like Dean missed mentioning the step where you add a function to your child theme’s functions.php file that adds your custom template to the array of available templates. Here’s a PHP code snippet you can add to your theme’s functions.php file that will do the job:

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;
}


nyingma

August 11, 2016 at 1:19 pm

And Bob’s your uncle! Work’s perfectly; thanks Josh’s.


Josh

  • Support Staff

August 11, 2016 at 2:26 pm

:+1:

The support post ‘Display Event Cart only when not empty? (redux)’ 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