Support

Home Forums Event Espresso Premium Custom plugin conflict with hooks to Promotions add-on in EE4?

Custom plugin conflict with hooks to Promotions add-on in EE4?

Posted: January 7, 2016 at 8:24 am

Viewing 9 reply threads


Harvey

January 7, 2016 at 8:24 am

We’ve created our own plugin to enable registration of families of members which we’ve pre-loaded into our database.

For free events, everything works perfectly. However, for paid events, members are seeing a request for a promotion code (which is confusing since we don’t have any). I’m guessing there’s a call in EE core to your promotion add-on that may be causing the conflict?

I’d like to see if there’s anything I might be able to explore (with my very modest php skills) before I have to go back to our developer to fix.

Any suggestions? I can send you a screen grab of the (undesired) screen if it helps – I can’t seem to add an attachment in this forum.

Many thanks.


Josh

  • Support Staff

January 7, 2016 at 8:34 am

Hi Harvey,

The promotion code field should display if the Promotions add-on is activated, that’s what it’s programmed to do. If you do not want the promotion code field to display you can deactivate the promotions add-on. Or if there are specific events where you don’t want the promotion code field to display, you can add the following snippet to your site in a plugin, and set a “coupon” custom field in the event to “no”.

https://github.com/eventespresso/ee-code-snippet-library/blob/master/addons/eea-promotions/jf_ee_promo_field_meta_key_override.php


Harvey

January 7, 2016 at 9:45 am

Thx Josh

I don’t have the promotions plugin so I’m guessing there’s some code in my Groups plugin that might make a similar call.

Am I able to create a php file from your snippet and put it into an appropriate directory and hope it works? If so, what directory should I create?


Josh

  • Support Staff

January 7, 2016 at 9:48 am

The snippet will not do anything if you do not have the promotions add-on activated. Since Event Espresso 4 core doesn’t have any built in promo code functionality, I should ask if you have any registration form questions or custom code that adds a promo code field?


Harvey

January 7, 2016 at 9:56 am

Nope. Nada.


Harvey

January 7, 2016 at 11:54 am

I’ll search our custom plugin for the word promo and see if i can find something


Harvey

January 7, 2016 at 12:04 pm

Looks like I have a reference to promo in several files in our espresso-ypogroups plugin for the group “Ypogroups”.

Do you have an easy suggestion on how to turn on the “off” switch?


~/espresso-ypogroups/admin/ypogroups/Ypogroups_Admin_Page.core.php:1257: //RO 				//we have to clone the ypogroup objects as well and then attach them to the new promo.
~/espresso-ypogroups/admin/ypogroups/Ypogroups_Admin_Page.core.php:1492: //RO 			EE_Question_Option::new_instance( array( 'QSO_value' => 'promo-banner-ribbon.template.php', 'QSO_desc' => __('Ribbon Banner', 'event_espresso'))),
~/espresso-ypogroups/admin/ypogroups/Ypogroups_Admin_Page.core.php:1493: //RO 			EE_Question_Option::new_instance( array( 'QSO_value' => 'promo-banner-plain-text.template.php', 'QSO_desc' => __('Plain Text', 'event_espresso'))),
~/espresso-ypogroups/EE_Ypogroups_Config.php:24: 	 * what to call promo codes on the frontend. ie: Promo codes, coupon codes, etc
~/espresso-ypogroups/EE_Ypogroups_Config.php:24: 	 * what to call promo codes on the frontend. ie: Promo codes, coupon codes, etc
~/espresso-ypogroups/EED_Ypogroups.module.php:288: 						'banner_text' 			=> implode( '<div class="ee-promo-separator-dv">+</div>', $banner_text ),
~/espresso-ypogroups/EED_Ypogroups.module.php:420: 	/********************************** SUBMIT PROMO CODE ***********************************/
~/espresso-ypogroups/EED_Ypogroups.module.php:493: 		// get promo code from $_REQUEST or use incoming default value
~/espresso-ypogroups/EED_Ypogroups.module.php:498: 		$promo = $EEM_Ypogroup->get_ypogroup_details_via_code( $promo_code );
~/espresso-ypogroups/EED_Ypogroups.module.php:499: 		if ( ! $promo instanceof EE_Ypogroup ) {
~/espresso-ypogroups/EED_Ypogroups.module.php:511: 		return $promo;
~/espresso-ypogroups/tags:795: promo	EED_Ypogroups.module.php	/^		$promo = $EEM_Ypogroup->get_ypogroup_details_via_code( $promo_code );$/;"	v
~/espresso-ypogroups/tags:795: promo	EED_Ypogroups.module.php	/^		$promo = $EEM_Ypogroup->get_ypogroup_details_via_code( $promo_code );$/;"	v


Josh

  • Support Staff

January 7, 2016 at 1:21 pm

No I do not because what you pasted here is out of context, the developer of the code in question will know the answer.


Harvey

January 8, 2016 at 6:32 am

Thx anyway. I guessed it was a shot in the dark.


Josh

  • Support Staff

January 8, 2016 at 7:38 am

I think you did find your answer Harvey, it turned out to be something in your custom plugin that’s adding the promo code field, and not Event Espresso core.

Viewing 9 reply threads

The support post ‘Custom plugin conflict with hooks to Promotions add-on in EE4?’ 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