Support

Home Forums Event Espresso Premium Promotional Coupon wrong description on checkout

Promotional Coupon wrong description on checkout

Posted: May 11, 2017 at 5:45 pm

Viewing 9 reply threads


manders

May 11, 2017 at 5:45 pm

We have some issue with promotional coupon description that being displayed during checkout.
The discount itself is working right, but showing wrong event in the description. Here is what I meant.
“Woodworking Junior Camp” was past event.
promotion code

We did duplicate events from past events and changed the description/title. Is it an issue?
How can we fix this? because this confuses our customers.

Thanks


Tony

  • Support Staff

May 12, 2017 at 3:54 am

Hi there,

It looks like the output for the promo code line items has been edited as it’s different from the default.

I would first check what the ‘Name’ of the promotion code is currently set to.

Go to: Event Espresso -> Promotions.

Find the code you are using on that event and check the name, what is it currently set to?


manders

May 12, 2017 at 4:42 am

Hi, thanks for your quick response.

It says “Sample Sale Code Take 10” , which is correct
promotion name

But the event info was wrong. It shows past event.


Tony

  • Support Staff

May 12, 2017 at 5:29 am

Can you link me to the event you are testing this on please?

Usually, something like this would be caused by caching, are you running any caching plugins?

The output for the promotion Line item has been altered, by default it should look like this :- http://take.ms/bc3El

Did you have a developer make changes to EE? If so how did they change the above?


manders

May 12, 2017 at 7:45 am

Here is the event link: https://www.arworkshop.com/playground/events/framed-wood/

We did make some modification, but only to the template file, EE core was not modified at all.
Can you tell me where does the file that output the promotion line item? I will try to check. We don’t mind if the promotion output like the default.

Thanks


manders

May 12, 2017 at 7:48 am

No we don’t use cache plugin, I removed it about 6 months ago.
We’re hosted on Siteground.


Josh

  • Support Staff

May 12, 2017 at 1:08 pm

Hi there,

All of the line items that get displayed there (prices and discounts) actually share the same code, so I suspect whatever the developer changed whether it be a change to a template or using a filter hook like
FHEE__EE_SPCO_Line_Item_Display_Strategy__item_row__name
Something like a change like that would cause the other name to appear there. So the name of the file that has that customization on your site could be named anything really. I’d recommend temporarily removing that customization to see if that fixes the issue for you.

  • This reply was modified 7 years, 6 months ago by Josh. Reason: FTFY


Tony

  • Support Staff

May 12, 2017 at 2:49 pm

As Josh mentioned it’s not really possible for us to say how the modifications were made, we can make some educated guesses but it depends on how the developer chose to change the output.

Check for translations on 'Discount: %1$s', this could be done through a plugin, function in functions.php or the PO/MO files.

Any code that’s hooking into FHEE__EE_SPCO_Line_Item_Display_Strategy__item_row__name or FHEE__EE_SPCO_Line_Item_Display_Strategy__item_row__desc.

Another thing to check is to create a NEW promo code (call it TEST PROMO for example) and test that on the event, what output does that show? Is it the promo name with the same date?


manders

May 12, 2017 at 3:46 pm

We had this in EE functions file – to add the event’s detail date/time.
If I remove it, it turns back to default.

function ee_revise_registration_checkout_line_item_desc(  $original_description, $line_item, $options ) {
  $datetime_names = array();
  if( $line_item->ticket() instanceof EE_Ticket ) {
    foreach( $line_item->ticket()->datetimes() as $datetime ) {
      $datetime_names[] = $datetime->get_dtt_display_name(true);
    }
  }
  return sprintf( __( ' for "%1$s", <br />Date/time: %2$s', 'event_espresso' ),
    $line_item->ticket_event_name(),
    implode(", ", $datetime_names ) );

}
add_filter ('FHEE__EE_SPCO_Line_Item_Display_Strategy__item_row__desc', 'ee_revise_registration_checkout_line_item_desc', 10, 3);

Is there any way to display the event date/time for the event but not on the discount?

thanks


Tony

  • Support Staff

May 15, 2017 at 3:34 am

Sure there is, you check the current line item object type to see if it’s a promotion using something like this:

$line_item->OBJ_type() === 'Promotion'

So in your conditional, you could have:

if( $line_item->ticket() instanceof EE_Ticket && $line_item->OBJ_type() !== 'Promotion' )

However, you’ll also need to change that function so that it only returns the modified string if it’s inside the above conditional, otherwise, return $original_description.

Right now if you managed to find a line item that wasn’t assigned to a ticket (there isn’t one currently but we could add them in the future) your function will break the descriptions as it doesn’t return the original description even if the function is not doing anything.

Viewing 9 reply threads

The support post ‘Promotional Coupon wrong description on checkout’ 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