Closed MilynNi closed 6 years ago
@MilynNi Thanks for the pull request. There are a couple of issues:
master
branch into your feature branch, instead of the other way around.$ticket->post_title
variable with the __()
get text function will cause some weird side effects because the parser that extracts all of the plugin's translation strings can't handle variables. Instead, it might be better to see if the shortcodes can be executed at some other point in the function.
Camptix works well for multilingual websites in general. However, I have an issue with the e-mails sent out to attendees on purchase of a ticket. The [receipt] in the e-mail templates (see the example further down) doesn’t isolate the appropriate language entered in the ticket title. I’m using the qTranslate-X plugin – which allows the ticket title to be entered in multiple languages, bracketed in the language code set by the plugin. In most other situations CampTix displays the Ticket Title correctly - in the language selected by the visitor.
At the moment attendees are getting messages with the language encoding embedded. e.g.
[:en]Test Event[:cy]Digwyddiad Brawf[:] (£15.00) x1 = £15.00
E-mail template example
The relevant line of code is 7124 in camptix.php
I’ve managed to successfully amend the code to:
$receipt_content .= sprintf( " %s (%s) x%d = %s\n", __($ticket->post_title), $this->append_currency( $item['price'], false ), $item['quantity'], $this->append_currency( $item['price'] $item['quantity'], false ) );
All I’ve done is wrap the $ticket->post_title in the __() function. Note that if there is no translation, or the text domain isn’t loaded, the original text is returned.
Would it be possible to incorporate this into the next release?
One other thing - there's a typo in the default registration question "Where did you here about us?" Could this also be corrected?