Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter Penelope

    (@penelopehathaway)

    Thank you for your support, I did exactly what you had displayed in your screenshots and just didn’t get it to display only one pricing on pageload. I ended up adding a script:

    That works now, you can close the ticket.

    document.addEventListener("DOMContentLoaded", function() {

    ? ? // Function to check the selected radio button and show/hide the related HTML field

    ? ? function applyConditionalLogic() {

    ? ? ? ? // First membership logic

    ? ? ? ? var selectedOption1 = document.querySelector('input[name="form_fields[payment_plan]"]:checked');

    ? ? ? ? if (selectedOption1) {

    ? ? ? ? ? ? if (selectedOption1.value === 'yearly') {

    ? ? ? ? ? ? ? ? // Show yearly pricing for first membership, hide monthly pricing

    ? ? ? ? ? ? ? ? document.querySelector('.elementor-field-group-field_72648a6').classList.remove('cfef-hidden');

    ? ? ? ? ? ? ? ? document.querySelector('.elementor-field-group-field_9f9887f').classList.add('cfef-hidden');

    ? ? ? ? ? ? ? ? document.querySelector('.elementor-field-group-field_b8b4395').classList.remove('cfef-hidden');

    ? ? ? ? ? ? } else {

    ? ? ? ? ? ? ? ? // Show monthly pricing for first membership, hide yearly pricing

    ? ? ? ? ? ? ? ? document.querySelector('.elementor-field-group-field_72648a6').classList.add('cfef-hidden');

    ? ? ? ? ? ? ? ? document.querySelector('.elementor-field-group-field_9f9887f').classList.remove('cfef-hidden');

    ? ? ? ? ? ? ? ? document.querySelector('.elementor-field-group-field_b8b4395').classList.add('cfef-hidden');

    ? ? ? ? ? ? }

    ? ? ? ? }

    ? ? ? ? // Second membership logic

    ? ? ? ? var selectedOption2 = document.querySelector('input[name="form_fields[second_payment_plan]"]:checked');

    ? ? ? ? if (selectedOption2) {

    ? ? ? ? ? ? if (selectedOption2.value === 'yearly') {

    ? ? ? ? ? ? ? ? // Show yearly pricing for second membership, hide monthly pricing

    ? ? ? ? ? ? ? ? document.querySelector('.elementor-field-group-field_2b0c9f0').classList.remove('cfef-hidden');

    ? ? ? ? ? ? ? ? document.querySelector('.elementor-field-group-field_5abe888').classList.add('cfef-hidden');

    ? ? ? ? ? ? ? ? document.querySelector('.elementor-field-group-field_2987ade').classList.remove('cfef-hidden');

    ? ? ? ? ? ? } else {

    ? ? ? ? ? ? ? ? // Show monthly pricing for first membership, hide yearly pricing

    ? ? ? ? ? ? ? ? document.querySelector('.elementor-field-group-field_2b0c9f0').classList.add('cfef-hidden');

    ? ? ? ? ? ? ? ? document.querySelector('.elementor-field-group-field_5abe888').classList.remove('cfef-hidden');

    ? ? ? ? ? ? ? ? document.querySelector('.elementor-field-group-field_2987ade').classList.add('cfef-hidden');

    ? ? ? ? ? ? }

    ? ? ? ? }

    ? ? }

    ? ? // Run the function on page load

    ? ? applyConditionalLogic();

    ? ? // Add event listeners to re-apply the logic when radio buttons are changed

    ? ? var radioButtons1 = document.querySelectorAll('input[name="form_fields[payment_plan]"]');

    ? ? radioButtons1.forEach(function(radio) {

    ? ? ? ? radio.addEventListener('change', applyConditionalLogic);

    ? ? });

    ? ? var radioButtons2 = document.querySelectorAll('input[name="form_fields[second_payment_plan]"]');

    ? ? radioButtons2.forEach(function(radio) {

    ? ? ? ? radio.addEventListener('change', applyConditionalLogic);

    ? ? });

    });
    Thread Starter Penelope

    (@penelopehathaway)

    Hey @gurpreetk1 ,

    https://learn.businessanalysisexperts.com/join-learn-business-analysis-by-example/ is where it is implemented on the first two pricing boxes, I had it deactivated yesterday because of some other fixes, sorry for that. I’ll leave it now for you.
    Thank you!

    Thread Starter Penelope

    (@penelopehathaway)

    Thank you for your support. It results also in the name change on both emails: admin new order & customer order confirmation.
    I used this code:

    add_filter('woocommerce_order_item_name', 'custom_order_item_name_for_admin_email', 10, 2);

    function custom_order_item_name_for_admin_email($item_name, $item) {

        $product_id = $item->get_product_id();

        // Check if the current email is the admin email

        if (is_admin_email() && has_term(146, 'product_cat', $product_id)){

            // Modify the order item name for admin email

            $item_name .= ' <strong>Single Sortiment</strong>';

        }

        return $item_name;

    }

    // Check if the current email is the admin email

    function is_admin_email() {

        // Get the current email object

        $current_email = WC()->mailer()->get_emails();

        // Check if the current email is the admin email

        if (isset($current_email['WC_Email_New_Order'])) {

            return true;

        }

        return false;

    }

    And I need this name change only in the admin new order email….can you adjust please?
    Thank you so much in advance.

    KInd regards,
    Penelope

    • This reply was modified 4 months, 2 weeks ago by Penelope.
    Penelope

    (@penelopehathaway)

    Hallo @hai3009,
    ich habe stundenlang wegen dem gleichem Problem Fehlersuche betrieben.
    Die L?sung war: in den Theme Optionen von Divi / Allgemein / Performance folgende Einstellung deaktivieren: Defer jQuery And jQuery Migrate.
    Vorsichtshalber dann noch Caches leeren.
    Herzliche Grü?e und viel Erfolg.

    Thread Starter Penelope

    (@penelopehathaway)

    Thank you very much Stephen, that did work.

    I only would need the Street, Zip code and City, though.

    How would I display that?

    Thread Starter Penelope

    (@penelopehathaway)

    Thank you @harvsisa for posting this, I tried, but it doesn’t work on my end.

    But I appreciate your note!

    Thread Starter Penelope

    (@penelopehathaway)

    Hi @harvisa, unfortunately not. I would still need a solution though, I just dropped it due to time constraints and lower priority level. What combination of theme, pluggins do you have? Yoast as well?

    Thread Starter Penelope

    (@penelopehathaway)

    Hey Stephen,

    with disabled Yoast the title in the browser tab is not showing either. The “0” (zero) is also not showing. It shows the separator that I had choosen and the blog name. (in my example it would be 0 – Evangelische Studenten….)Those two settings are done outside the Events Organiser.

    Seemingly there is no content in the database field for the taxonomy titles. Yoast displays it as a zero, without Yoast it is displaying nothing.

    Now I switched themes and the browser tab is showing the correct meta title.

    https://preview1.virtualassistantforyou.de/veranstaltungsort/kellerkapelle-der-esg/

    At this point I think: it must be theme related (Divi Theme from Elegant theme). Can you advice Elegant Theme what they have have to change for it to work?

    But then I changed the setting how to treat templates back to standard, it was back to showing the “0” in the browser tab.

    So, what could cause this?

Viewing 8 replies - 1 through 8 (of 8 total)