kickdrummtl
Forum Replies Created
-
Alright, thanks for everything @abzlevelup . I’ve taken up enough of your time as is haha, I’m marking this as resolved. I’ll inform myself further on child themes and further implementing customization in my spare time, but this answers my direct need.
Hi @abzlevelup, my apologies on the child theme thing. I’m still struggling. I created a child theme with the plugin you suggested and seem to have no issues on that front, but then tried adding a content-inactive.php (same one i pasted earlier) to kickdrum.ca/wp-content/themes/Avada-child/tribe/tickets/blocks/tickets, purged cache, still nothing.
As for the additional css solution, curious as to why it’s not recommended?
That solution ended up working for me. I’d like to ask however: Given I’m trying to change the text that reads “Tickets are no longer available”, I’m having a little issue in the fact that the text isn’t wrapped in a span. I tried:.single-tribe_events .tribe-tickets__tickets-item-content--inactive { display: none !important; } .single-tribe_events .tribe-tickets__tickets-item-content--inactive:after { content: 'This is a sample text' !important; }but this doesn’t work either as it prevents the :after from appearing as well. For now, I’ve appended text to the end of the sentence instead of replacing it, but was wondering what the cleaner solution would be hear.
Thanks for everything by the way, you’ve been stellar in your assistance.
Hi @abzlevelup, I went and created subfolders inside the [theme]/tribe folder until I had:
/kickdrum.ca/wp-content/themes/Avada/tribe/tickets/blocks/tickets/ inside which I created a content-inactive.php file. I then put the following code:
<?php /** * Block: Tickets * Inactive Content * * Override this template in your own theme by creating a file at: * [your-theme]/tribe/tickets/blocks/tickets/content-inactive.php * * See more documentation about our Blocks Editor templating system. * * @link https://evnt.is/1amp Help article for RSVP & Ticket template files. * * @since 4.12.1 Updated message to use tribe_get_ticket_label_plural() for "Tickets" string * @version 4.12.1 * */ /* translators: %s: Tickets label */ $message = $this->get( 'is_sale_past' ) ? sprintf( __( '%s are no longer available for pre-sale but you may purchase tickets (cash only) at the door', 'event-tickets' ), tribe_get_ticket_label_plural( 'event-tickets' ) ) : sprintf( __( '%s are not yet available', 'event-tickets' ), tribe_get_ticket_label_plural( 'event-tickets' ) ); ?> <div class="tribe-tickets__item__content tribe-tickets__item__content--inactive" > <?php echo esc_html( $message ) ?> </div>The message stays the same. example: https://kickdrum.ca/event/rufus-cesspool-esco/
I also tried editing the file in the original location (/kickdrum.ca/wp-content/plugins/event-tickets/src/views/blocks/tickets/content-inactive.php) to no avail either.
I also noticed that when I inspect the element on the site, it does indeed seem to be related to content-inactive as the div contains: tribe-tickets__tickets-item-content tribe-tickets__tickets-item-content–inactiveDo you know what I may have done wrong? Thank you.
- This reply was modified 3 years, 11 months ago by kickdrummtl.
- This reply was modified 3 years, 11 months ago by kickdrummtl.
- This reply was modified 3 years, 11 months ago by kickdrummtl.
- This reply was modified 3 years, 11 months ago by kickdrummtl.
to add, I have tried playing around with shorter text snippets (like just changing “longer” to another word) and it did nothing
I have decided to paste here the entire functions.php file if ever it is relevant. This is the first custom function I have added to it
<?php /** * Extra files & functions are hooked here. * * Displays all of the head element and everything up until the "site-content" div. * * @package Avada * @subpackage Core * @since 1.0 */ // Do not allow directly accessing this file. if ( ! defined( 'ABSPATH' ) ) { exit( 'Direct script access denied.' ); } if ( ! defined( 'AVADA_VERSION' ) ) { define( 'AVADA_VERSION', '7.7.1' ); } if ( ! defined( 'AVADA_MIN_PHP_VER_REQUIRED' ) ) { define( 'AVADA_MIN_PHP_VER_REQUIRED', '5.6' ); } if ( ! defined( 'AVADA_MIN_WP_VER_REQUIRED' ) ) { define( 'AVADA_MIN_WP_VER_REQUIRED', '4.9' ); } // Developer mode. if ( ! defined( 'AVADA_DEV_MODE' ) ) { define( 'AVADA_DEV_MODE', false ); } /** * Compatibility check. * * Check that the site meets the minimum requirements for the theme before proceeding. * * @since 6.0 */ if ( version_compare( $GLOBALS['wp_version'], AVADA_MIN_WP_VER_REQUIRED, '<' ) || version_compare( PHP_VERSION, AVADA_MIN_PHP_VER_REQUIRED, '<' ) ) { require_once get_template_directory() . '/includes/bootstrap-compat.php'; return; } /** * Bootstrap the theme. * * @since 6.0 */ require_once get_template_directory() . '/includes/bootstrap.php'; /* Omit closing PHP tag to avoid "Headers already sent" issues. */ /* * EXAMPLE OF CHANGING ANY TEXT (STRING) IN THE EVENTS CALENDAR * See the codex to learn more about WP text domains: * http://codex.ww.wp.xz.cn/Translating_WordPress#Localization_Technology * Example Tribe domains: 'tribe-events-calendar', 'tribe-events-calendar-pro'... */ /** * Put your custom text here in a key => value pair * Example: 'Text you want to change' => 'This is what it will be changed to'. * The text you want to change is the key, and it is case-sensitive. * The text you want to change it to is the value. * You can freely add or remove key => values, but make sure to separate them with a comma. * This example changes the label "Venue" to "Location", "Related Events" to "Similar Events", and "(Now or date) onwards" to "Calendar - you can discard the dynamic portion of the text as well if desired. */ function tribe_replace_strings() { $custom_text = [ 'Tickets are no longer available' => 'Pre-sale tickets are no longer available but you may purchase tickets (cash only) at the door', ]; return $custom_text; } function tribe_custom_theme_text ( $translation, $text, $domain ) { // If this text domain doesn't start with "tribe-", "the-events-", or "event-" bail. if ( ! check_if_tec_domains( $domain ) ) { return $translation; } // String replacement. $custom_text = tribe_replace_strings(); // If we don't have replacement text in our array, return the original (translated) text. if ( empty( $custom_text[$translation] ) ) { return $translation; } return $custom_text[$translation]; } function tribe_custom_theme_text_plurals ( $translation, $single, $plural, $number, $domain ) { // If this text domain doesn't start with "tribe-", "the-events-", or "event-" bail. if ( ! check_if_tec_domains( $domain ) ) { return $translation; } /** If you want to use the number in your logic, this is where you'd do it. * Make sure you return as part of this, so you don't call the function at the end and undo your changes! */ // If we're not doing any logic up above, just make sure your desired changes are in the $custom_text array above (in the <code>tribe_custom_theme_text</code> filter. ) if ( 1 === $number ) { return tribe_custom_theme_text ( $translation, $single, $domain ); } else { return tribe_custom_theme_text ( $translation, $plural, $domain ); } } function tribe_custom_theme_text_with_context ( $translation, $text, $context, $domain ) { // If this text domain doesn't start with "tribe-", "the-events-", or "event-" bail. if ( ! check_if_tec_domains( $domain ) ) { return $translation; } /** If you want to use the context in your logic, this is where you'd do it. * Make sure you return as part of this, so you don't call the function at the end and undo your changes! * Example (here, we don't want to do anything when the context is "edit", but if it's "view" we want to change it to "Tribe"): * if ( 'edit' === strtolower( $context ) ) { * return $translation; * } elseif( 'view' === strtolower( $context ) ) { * return "Tribe"; * } * * Feel free to use the same logic we use in tribe_custom_theme_text() above for key => value pairs for this logic. */ // If we're not doing any logic up above, just make sure your desired changes are in the $custom_text array above (in the <code>tribe_custom_theme_text</code> filter. ) return tribe_custom_theme_text ( $translation, $text, $domain ); } function tribe_custom_theme_text_plurals_with_context ( $translation, $single, $plural, $number, $context, $domain ) { // If this text domain doesn't start with "tribe-", "the-events-", or "event-" bail. if ( ! check_if_tec_domains( $domain ) ) { return $translation; } /** * If you want to use the context in your logic, this is where you'd do it. * Make sure you return as part of this, so you don't call the function at the end and undo your changes! * Example (here, we don't want to do anything when the context is "edit", but if it's "view" we want to change it to "Tribe"): * if ( 'edit' === strtolower( $context ) ) { * return $translation; * } elseif( 'view' === strtolower( $context ) ) { * return "cat"; * } * * You'd do something as well here for singular/plural. This could get complicated quickly if it has to interact with context as well. * Example: * if ( 1 === $number ) { * return "cat"; * } else { * return "cats"; * } * Feel free to use the same logic we use in tribe_custom_theme_text() above for key => value pairs for this logic. */ // If we're not doing any logic up above, just make sure your desired changes are in the $custom_text array above (in the <code>tribe_custom_theme_text</code> filter. ) if ( 1 === $number ) { return tribe_custom_theme_text ( $translation, $single, $domain ); } else { return tribe_custom_theme_text ( $translation, $plural, $domain ); } } function check_if_tec_domains( $domain ) { $is_tribe_domain = strpos( $domain, 'tribe-' ) === 0; $is_tec_domain = strpos( $domain, 'the-events-' ) === 0; $is_event_domain = strpos( $domain, 'event-' ) === 0; // If this text domain doesn't start with "tribe-", "the-events-", or "event-" bail. if ( ! $is_tribe_domain && ! $is_tec_domain && ! $is_event_domain ) { return false; } return true; } // Base. add_filter( 'gettext', 'tribe_custom_theme_text', 20, 3 ); // Plural-aware translations. add_filter( 'ngettext', 'tribe_custom_theme_text_plurals', 20, 5 ); // Translations with context. add_filter( 'gettext_with_context', 'tribe_custom_theme_text_with_context', 20, 4 ); // Plural-aware translations with context. add_filter( 'ngettext_with_context', 'tribe_custom_theme_text_plurals_with_context', 20, 6 );Hi, I tried adding the code snippet to my theme’s (Avada) functions.php. I made sure to remove the <?php tag because my theme already contained one
I changed the relevant function to:
function tribe_replace_strings() { $custom_text = [ 'Tickets are no longer available' => 'Pre-sale tickets are no longer available but you may purchase tickets (cash only) at the door', ]; return $custom_text; }but the text hasn’t changed. Inspecting the element shows that there’s no special logic to the front-end text I think?
example of page: https://kickdrum.ca/event/john-lost-brontae-friends-lucas-dubovic-group-azulov-diving-bell/
Am i forgetting to call the function somewhere or something?
- This reply was modified 4 years ago by kickdrummtl.
- This reply was modified 4 years ago by kickdrummtl.
- This reply was modified 4 years ago by kickdrummtl.
Forum: Plugins
In reply to: [Event Tickets and Registration] Wrong price after cancelled ticket purchaseHey @juanfra okay, now it’s 100% resolved with your script! Thank you. Honestly some of the best and least frustrating tech support I’ve ever had. B)
Forum: Plugins
In reply to: [Event Tickets and Registration] Wrong price after cancelled ticket purchaseOh, @juanfra I’m going to try that, one sec.
Forum: Plugins
In reply to: [Event Tickets and Registration] Wrong price after cancelled ticket purchaseAlright, I’ll try to look into it during my spare time though it definitely goes a bit above my head. I’ll maybe post a reply here and tag you if I figure it out, but for the time being I’m going to mark this issue as resolved. Thanks again!
Forum: Plugins
In reply to: [Event Tickets and Registration] Wrong price after cancelled ticket purchaseHi @juanfra , yup that seems to have fixed it and Paypal works. Would you know what I should do moving forward to try to get an optimizer to work with Event Tickets? Thanks for everything by the way, you’ve been very helpful and quick.
Forum: Plugins
In reply to: [Event Tickets and Registration] Wrong price after cancelled ticket purchaseHi @juanfra ,
We’re currently not getting much traffic for one of our events so for the time being I’m going to leave it on Tickets Commerce so you can help me. Event linkI’m not seeing any significant console errors.
Hopefully you can check it out in good time so I can go back to running a functional ticket on that event 🙂
Forum: Plugins
In reply to: [Event Tickets and Registration] Wrong price after cancelled ticket purchaseHi @juanfra ,
I’d love to show you on the site but don’t want to tweak it on this site as the events are currently in use and I don’t want users to be unable to purchase tickets right now. Would there be a way to time this so that there is minimum downtime for the users?It is definitely in live mode and I connected the same live account I used for the other two. No error messages or anything. Here is a screenshot of the Paypal connection page (I have obfuscated the connection code, idk if that’s sensitive info)
In the meantime, I took the liberty to disable Tribe Commerce, enable Tickets Commerce, and create a ticket very temporarily and took a screenshot of what the page looks like:
- This reply was modified 4 years, 2 months ago by kickdrummtl. Reason: hidden image oops
Forum: Plugins
In reply to: [Event Tickets and Registration] Wrong price after cancelled ticket purchaseHi Juan! I was basically unable to set up Paypal with Tickets Commerce. I connect the Paypal, it says it’s connected, and then no payment option shows up when one goes to buy a ticket. Paypal has been working with Tribe Commerce and with WooCommerce, so I can’t really understand what the issue is.
Thank you